学习了各种数据库,关于具体数据库的命令总有会忘记的,在技术管理岗时间长了,有时候最基本的也忘记了。不用怕,记住关键的就可以,那就是help命令。
mysql> help contents;
+----------------------+------------------------+----------------+
| source_category_name | name | is_it_category |
+----------------------+------------------------+----------------+
| Contents | Account Management | Y |
| Contents | Administration | Y |
| Contents | Components | Y |
| Contents | Compound Statements | Y |
| Contents | Contents | Y |
| Contents | Data Definition | Y |
| Contents | Data Manipulation | Y |
| Contents | Data Types | Y |
| Contents | Functions | Y |
| Contents | Geographic Features | Y |
| Contents | Help Metadata | Y |
| Contents | Language Structure | Y |
| Contents | Plugins | Y |
| Contents | Storage Engines | Y |
| Contents | Table Maintenance | Y |
| Contents | Transactions | Y |
| Contents | User-Defined Functions | Y |
| Contents | Utility | Y |
+----------------------+------------------------+----------------+
18 rows in set
注意mysql8后面搜索的内容提示必须加引号,否则不识别。
注意mysql8后面搜索的内容提示必须加引号,否则不识别。
注意mysql8后面搜索的内容提示必须加引号,否则不识别。
注意mysql8后面搜索的内容提示必须加引号,否则不识别。
mysql> help Language Structure ;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Structure' at line 1
mysql> help 'Language Structure' ;
+----------------------+-------+----------------+
| source_category_name | name | is_it_category |
+----------------------+-------+----------------+
| Language Structure | FALSE | N |
| Language Structure | TRUE | N |
+----------------------+-------+----------------+
2 rows in set
mysql> help create;
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'create' at line 1
正确的查找打开方式:
mysql> help 'create';
+---------------------------------+----------------+
| name | is_it_category |
+---------------------------------+----------------+
| CREATE DATABASE | N |
| CREATE EVENT | N |
| CREATE FUNCTION | N |
| CREATE FUNCTION UDF | N |
| CREATE INDEX | N |
| CREATE LOGFILE GROUP | N |
| CREATE PROCEDURE | N |
| CREATE RESOURCE GROUP | N |
| CREATE ROLE | N |
| CREATE SCHEMA | N |
| CREATE SERVER | N |
| CREATE SPATIAL REFERENCE SYSTEM | N |
| CREATE TABLE | N |
| CREATE TABLESPACE | N |
| CREATE TRIGGER | N |
| CREATE USER | N |
| CREATE VIEW | N |
| SHOW | N |
| SHOW CREATE DATABASE | N |
| SHOW CREATE EVENT | N |
| SHOW CREATE FUNCTION | N |
| SHOW CREATE PROCEDURE | N |
| SHOW CREATE SCHEMA | N |
| SHOW CREATE TABLE | N |
| SHOW CREATE USER | N |
| SPATIAL INDEXES | N |
+---------------------------------+----------------+
26 rows in set
mysql> help 'create index';
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+
| name | description | example |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+
| CREATE INDEX | Syntax:
CREATE [UNIQUE | FULLTEXT | SPATIAL] INDEX index_name
[index_type]
ON tbl_name (key_part,...)
[index_option]
[algorithm_option | lock_option] ...
key_part: {col_name [(length)] | (expr)} [ASC | DESC]
index_option:
KEY_BLOCK_SIZE [=] value
| index_type
| WITH PARSER parser_name
| COMMENT 'string'
| {VISIBLE | INVISIBLE}
index_type:
USING {BTREE | HASH}
algorithm_option:
ALGORITHM [=] {DEFAULT | INPLACE | COPY}
lock_option:
LOCK [=] {DEFAULT | NONE | SHARED | EXCLUSIVE}
Normally, you create all indexes on a table at the time the table
itself is created with CREATE TABLE. See [HELP CREATE TABLE]. This
guideline is especially important for InnoDB tables, where the primary
key determines the physical layout of rows in the data file. CREATE
INDEX enables you to add indexes to existing tables.
CREATE INDEX is mapped to an ALTER TABLE statement to create indexes.
See [HELP ALTER TABLE]. CREATE INDEX cannot be used to create a PRIMARY
KEY; use ALTER TABLE instead. For more information about indexes, see
https://dev.mysql.com/doc/refman/8.0/en/mysql-indexes.html.
URL: https://dev.mysql.com/doc/refman/8.0/en/create-index.html
| |
+--------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------+
1 row in set
推荐好文:
MySQL 的 help 命令你真的会用吗?https://blog.csdn.net/woqutechteam/article/details/81115892