- 浏览: 740193 次
- 性别:
- 来自: 杭州
文章分类
最新评论
-
lgh1992314:
a offset: 26b offset: 24c offse ...
java jvm字节占用空间分析 -
ls0609:
语音实现在线听书http://blog.csdn.net/ls ...
Android 语音输入API使用 -
wangli61289:
http://viralpatel-net-tutorials ...
Android 语音输入API使用 -
zxjlwt:
学习了素人派http://surenpi.com
velocity宏加载顺序 -
tt5753:
谢啦........
Lucene的IndexWriter初始化时的LockObtainFailedException的解决方法
mysql有很完善的帮助文档,在mysql命令行下可以通过? 或者help 加上命令可以查看改命令的帮助信息,
我们查下几个常用的help命令
第一层帮助信息:
? contents;
mysql> ? contents; You asked for help about help category: "Contents" For more information, type 'help <item>', where <item> is one of the following categories: Account Management Administration Compound Statements Data Definition Data Manipulation Data Types Functions Functions and Modifiers for Use with GROUP BY Geographic Features Help Metadata Language Structure Plugins Table Maintenance Transactions User-Defined Functions Utility
再查看具体每一层的帮助信息
mysql> ? Account Management;
You asked for help about help category: "Account Management" For more information, type 'help <item>', where <item> is one of the following topics: CREATE USER DROP USER GRANT RENAME USER REVOKE SET PASSWORD mysql> ? Administration You asked for help about help category: "Administration" For more information, type 'help <item>', where <item> is one of the following topics: BINLOG CACHE INDEX CHANGE MASTER TO DEALLOCATE PREPARE EXECUTE STATEMENT FLUSH FLUSH QUERY CACHE HELP COMMAND KILL LOAD INDEX PREPARE PURGE BINARY LOGS RESET RESET MASTER RESET SLAVE SET SET GLOBAL SQL_SLAVE_SKIP_COUNTER SET SQL_LOG_BIN SHOW SHOW AUTHORS SHOW BINARY LOGS SHOW BINLOG EVENTS SHOW CHARACTER SET SHOW COLLATION SHOW COLUMNS SHOW CONTRIBUTORS SHOW CREATE DATABASE SHOW CREATE EVENT SHOW CREATE FUNCTION SHOW CREATE PROCEDURE SHOW CREATE TABLE SHOW CREATE TRIGGER SHOW CREATE VIEW SHOW DATABASES SHOW ENGINE SHOW ENGINES SHOW ERRORS SHOW EVENTS SHOW FUNCTION CODE SHOW FUNCTION STATUS SHOW GRANTS SHOW INDEX SHOW MASTER STATUS SHOW OPEN TABLES SHOW PLUGINS SHOW PRIVILEGES SHOW PROCEDURE CODE SHOW PROCEDURE STATUS SHOW PROCESSLIST SHOW PROFILE SHOW PROFILES SHOW RELAYLOG EVENTS SHOW SLAVE HOSTS SHOW SLAVE STATUS SHOW STATUS SHOW TABLE STATUS SHOW TABLES SHOW TRIGGERS SHOW VARIABLES SHOW WARNINGS START SLAVE STOP SLAVE mysql> ? Compound Statements; You asked for help about help category: "Compound Statements" For more information, type 'help <item>', where <item> is one of the following topics: BEGIN END CASE STATEMENT CLOSE DECLARE CONDITION DECLARE CURSOR DECLARE HANDLER DECLARE VARIABLE FETCH IF STATEMENT ITERATE LEAVE LOOP OPEN REPEAT LOOP RESIGNAL RETURN SELECT INTO SET VARIABLE SIGNAL WHILE mysql> ? Data Definition; You asked for help about help category: "Data Definition" For more information, type 'help <item>', where <item> is one of the following topics: ALTER DATABASE ALTER EVENT ALTER FUNCTION ALTER PROCEDURE ALTER SERVER ALTER TABLE ALTER VIEW CONSTRAINT CREATE DATABASE CREATE EVENT CREATE FUNCTION CREATE INDEX CREATE PROCEDURE CREATE SERVER CREATE TABLE CREATE TRIGGER CREATE VIEW DROP DATABASE DROP EVENT DROP FUNCTION DROP INDEX DROP PROCEDURE DROP SERVER DROP TABLE DROP TRIGGER DROP VIEW MERGE RENAME TABLE TRUNCATE TABLE
这里可以根据不同的分类显示每个分类下支持的mysql指令
mysql> ? START SLAVE;
Name: 'START SLAVE' Description: Syntax: START SLAVE [thread_type [, thread_type] ... ] START SLAVE [SQL_THREAD] UNTIL MASTER_LOG_FILE = 'log_name', MASTER_LOG_POS = log_pos START SLAVE [SQL_THREAD] UNTIL RELAY_LOG_FILE = 'log_name', RELAY_LOG_POS = log_pos thread_type: IO_THREAD | SQL_THREAD START SLAVE with no thread_type options starts both of the slave threads. The I/O thread reads events from the master server and stores them in the relay log. The SQL thread reads events from the relay log and executes them. START SLAVE requires the SUPER privilege. If START SLAVE succeeds in starting the slave threads, it returns without any error. However, even in that case, it might be that the slave threads start and then later stop (for example, because they do not manage to connect to the master or read its binary log, or some other problem). START SLAVE does not warn you about this. You must check the slave's error log for error messages generated by the slave threads, or check that they are running satisfactorily with SHOW SLAVE STATUS. URL: http://dev.mysql.com/doc/refman/5.5/en/start-slave.html mysql> ? MERGE Name: 'MERGE' Description: The MERGE storage engine, also known as the MRG_MyISAM engine, is a collection of identical MyISAM tables that can be used as one. "Identical" means that all tables have identical column and index information. You cannot merge MyISAM tables in which the columns are listed in a different order, do not have exactly the same columns, or have the indexes in different order. However, any or all of the MyISAM tables can be compressed with myisampack. See http://dev.mysql.com/doc/refman/5.5/en/myisampack.html. Differences in table options such as AVG_ROW_LENGTH, MAX_ROWS, or PACK_KEYS do not matter. URL: http://dev.mysql.com/doc/refman/5.5/en/merge-storage-engine.html Examples: mysql> CREATE TABLE t1 ( -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, -> message CHAR(20)) ENGINE=MyISAM mysql> CREATE TABLE t2 ( -> a INT NOT NULL AUTO_INCREMENT PRIMARY KEY, -> message CHAR(20)) ENGINE=MyISAM mysql> INSERT INTO t1 (message) VALUES ('Testing'),('table'),('t1') mysql> INSERT INTO t2 (message) VALUES ('Testing'),('table'),('t2') mysql> CREATE TABLE total ( -> a INT NOT NULL AUTO_INCREMENT, -> message CHAR(20), INDEX(a)) -> ENGINE=MERGE UNION=(t1,t2) INSERT_METHOD=LAST mysql> ? create table; Name: 'CREATE TABLE' Description: Syntax: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name (create_definition,...) [table_options] [partition_options] Or: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name [(create_definition,...)] [table_options] [partition_options] select_statement Or: CREATE [TEMPORARY] TABLE [IF NOT EXISTS] tbl_name { LIKE old_tbl_name | (LIKE old_tbl_name) } create_definition: col_name column_definition | [CONSTRAINT [symbol]] PRIMARY KEY [index_type] (index_col_name,...) [index_option] ... | {INDEX|KEY} [index_name] [index_type] (index_col_name,...) [index_option] ... | [CONSTRAINT [symbol]] UNIQUE [INDEX|KEY] [index_name] [index_type] (index_col_name,...) [index_option] ... | {FULLTEXT|SPATIAL} [INDEX|KEY] [index_name] (index_col_name,...) [index_option] ... | [CONSTRAINT [symbol]] FOREIGN KEY [index_name] (index_col_name,...) reference_definition | CHECK (expr) column_definition: data_type [NOT NULL | NULL] [DEFAULT default_value] [AUTO_INCREMENT] [UNIQUE [KEY] | [PRIMARY] KEY] [COMMENT 'string'] [COLUMN_FORMAT {FIXED|DYNAMIC|DEFAULT}] [reference_definition] data_type: BIT[(length)] | TINYINT[(length)] [UNSIGNED] [ZEROFILL] | SMALLINT[(length)] [UNSIGNED] [ZEROFILL] | MEDIUMINT[(length)] [UNSIGNED] [ZEROFILL] | INT[(length)] [UNSIGNED] [ZEROFILL] | INTEGER[(length)] [UNSIGNED] [ZEROFILL] | BIGINT[(length)] [UNSIGNED] [ZEROFILL] | REAL[(length,decimals)] [UNSIGNED] [ZEROFILL] | DOUBLE[(length,decimals)] [UNSIGNED] [ZEROFILL] | FLOAT[(length,decimals)] [UNSIGNED] [ZEROFILL] | DECIMAL[(length[,decimals])] [UNSIGNED] [ZEROFILL] | NUMERIC[(length[,decimals])] [UNSIGNED] [ZEROFILL] | DATE | TIME | TIMESTAMP | DATETIME | YEAR | CHAR[(length)] [CHARACTER SET charset_name] [COLLATE collation_name] | VARCHAR(length) [CHARACTER SET charset_name] [COLLATE collation_name] | BINARY[(length)] | VARBINARY(length) | TINYBLOB | BLOB | MEDIUMBLOB | LONGBLOB | TINYTEXT [BINARY] [CHARACTER SET charset_name] [COLLATE collation_name] | TEXT [BINARY] [CHARACTER SET charset_name] [COLLATE collation_name] | MEDIUMTEXT [BINARY] [CHARACTER SET charset_name] [COLLATE collation_name] | LONGTEXT [BINARY] [CHARACTER SET charset_name] [COLLATE collation_name] | ENUM(value1,value2,value3,...) [CHARACTER SET charset_name] [COLLATE collation_name] | SET(value1,value2,value3,...) [CHARACTER SET charset_name] [COLLATE collation_name] | spatial_type index_col_name: col_name [(length)] [ASC | DESC] index_type: USING {BTREE | HASH} index_option: KEY_BLOCK_SIZE [=] value | index_type | WITH PARSER parser_name | COMMENT 'string' reference_definition: REFERENCES tbl_name (index_col_name,...) [MATCH FULL | MATCH PARTIAL | MATCH SIMPLE] [ON DELETE reference_option] [ON UPDATE reference_option] reference_option: RESTRICT | CASCADE | SET NULL | NO ACTION table_options: table_option [[,] table_option] ... table_option: ENGINE [=] engine_name | AUTO_INCREMENT [=] value | AVG_ROW_LENGTH [=] value | [DEFAULT] CHARACTER SET [=] charset_name | CHECKSUM [=] {0 | 1} | [DEFAULT] COLLATE [=] collation_name | COMMENT [=] 'string' | CONNECTION [=] 'connect_string' | DATA DIRECTORY [=] 'absolute path to directory' | DELAY_KEY_WRITE [=] {0 | 1} | INDEX DIRECTORY [=] 'absolute path to directory' | INSERT_METHOD [=] { NO | FIRST | LAST } | KEY_BLOCK_SIZE [=] value | MAX_ROWS [=] value | MIN_ROWS [=] value | PACK_KEYS [=] {0 | 1 | DEFAULT} | PASSWORD [=] 'string' | ROW_FORMAT [=] {DEFAULT|DYNAMIC|FIXED|COMPRESSED|REDUNDANT|COMPACT} | UNION [=] (tbl_name[,tbl_name]...) partition_options: PARTITION BY { [LINEAR] HASH(expr) | [LINEAR] KEY(column_list) | RANGE{(expr) | COLUMNS(column_list)} | LIST{(expr) | COLUMNS(column_list)} } [PARTITIONS num] [SUBPARTITION BY { [LINEAR] HASH(expr) | [LINEAR] KEY(column_list) } [SUBPARTITIONS num] ] [(partition_definition [, partition_definition] ...)] partition_definition: PARTITION partition_name [VALUES {LESS THAN {(expr | value_list) | MAXVALUE} | IN (value_list)}] [[STORAGE] ENGINE [=] engine_name] [COMMENT [=] 'comment_text' ] [DATA DIRECTORY [=] 'data_dir'] [INDEX DIRECTORY [=] 'index_dir'] [MAX_ROWS [=] max_number_of_rows] [MIN_ROWS [=] min_number_of_rows] [(subpartition_definition [, subpartition_definition] ...)] subpartition_definition: SUBPARTITION logical_name [[STORAGE] ENGINE [=] engine_name] [COMMENT [=] 'comment_text' ] [DATA DIRECTORY [=] 'data_dir'] [INDEX DIRECTORY [=] 'index_dir'] [MAX_ROWS [=] max_number_of_rows] [MIN_ROWS [=] min_number_of_rows] select_statement: [IGNORE | REPLACE] [AS] SELECT ... (Some legal select statement) CREATE TABLE creates a table with the given name. You must have the CREATE privilege for the table. Rules for permissible table names are given in http://dev.mysql.com/doc/refman/5.5/en/identifiers.html. By default, the table is created in the default database, using the InnoDB storage engine. An error occurs if the table exists, if there is no default database, or if the database does not exist. URL: http://dev.mysql.com/doc/refman/5.5/en/create-table.html mysql>
至于上面一层的命令,我们还可以查看mysql支持的数据类型,
mysql> ? Data Types; You asked for help about help category: "Data Types" For more information, type 'help <item>', where <item> is one of the following topics: AUTO_INCREMENT BIGINT BINARY BIT BLOB BLOB DATA TYPE BOOLEAN CHAR CHAR BYTE DATE DATETIME DEC DECIMAL DOUBLE DOUBLE PRECISION ENUM FLOAT INT INTEGER LONGBLOB LONGTEXT MEDIUMBLOB MEDIUMINT MEDIUMTEXT SET DATA TYPE SMALLINT TEXT TIME TIMESTAMP TINYBLOB TINYINT TINYTEXT VARBINARY VARCHAR YEAR DATA TYPE mysql> ? Utility; You asked for help about help category: "Utility" For more information, type 'help <item>', where <item> is one of the following topics: DESCRIBE EXPLAIN HELP STATEMENT USE
通过帮助文档还是很方便查到mysql的所有名称,已经每个命令的使用方法和语法。
可以查看mysql内置函数列表,以及每个函数的功能和使用方法:
mysql> ? Functions; You asked for help about help category: "Functions" For more information, type 'help <item>', where <item> is one of the following topics: PROCEDURE ANALYSE categories: Bit Functions Comparison operators Control flow functions Date and Time Functions Encryption Functions Information Functions Logical operators Miscellaneous Functions Numeric Functions String Functions mysql> ? String Functions; You asked for help about help category: "String Functions" For more information, type 'help <item>', where <item> is one of the following topics: ASCII BIN BINARY OPERATOR BIT_LENGTH CAST CHAR FUNCTION CHARACTER_LENGTH CHAR_LENGTH CONCAT CONCAT_WS CONVERT ELT EXPORT_SET EXTRACTVALUE FIELD FIND_IN_SET FORMAT HEX INSERT FUNCTION INSTR LCASE LEFT LENGTH LIKE LOAD_FILE LOCATE LOWER LPAD LTRIM MAKE_SET MATCH AGAINST MID NOT LIKE NOT REGEXP OCTET_LENGTH ORD POSITION QUOTE REGEXP REPEAT FUNCTION REPLACE FUNCTION REVERSE RIGHT RPAD RTRIM SOUNDEX SOUNDS LIKE SPACE STRCMP SUBSTR SUBSTRING SUBSTRING_INDEX TRIM UCASE UNHEX UPDATEXML UPPER mysql> ? QUOTE; Name: 'QUOTE' Description: Syntax: QUOTE(str) Quotes a string to produce a result that can be used as a properly escaped data value in an SQL statement. The string is returned enclosed by single quotation marks and with each instance of backslash ("\"), single quote ("'"), ASCII NUL, and Control+Z preceded by a backslash. If the argument is NULL, the return value is the word "NULL" without enclosing single quotation marks. URL: http://dev.mysql.com/doc/refman/5.5/en/string-functions.html Examples: mysql> SELECT QUOTE('Don\'t!') -> 'Don\'t!' mysql> SELECT QUOTE(NULL) -> NULL mysql>
mysql的插件信息和事务之类的其他信息
mysql> ? Plugins; Name: 'SHOW PLUGINS' Description: Syntax: SHOW PLUGINS SHOW PLUGINS displays information about server plugins. Plugin information is also available in the INFORMATION_SCHEMA.PLUGINS table. See http://dev.mysql.com/doc/refman/5.5/en/plugins-table.html. Example of SHOW PLUGINS output: mysql> SHOW PLUGINS\G *************************** 1. row *************************** Name: binlog Status: ACTIVE Type: STORAGE ENGINE Library: NULL License: GPL *************************** 2. row *************************** Name: CSV Status: ACTIVE Type: STORAGE ENGINE Library: NULL License: GPL *************************** 3. row *************************** Name: MEMORY Status: ACTIVE Type: STORAGE ENGINE Library: NULL License: GPL *************************** 4. row *************************** Name: MyISAM Status: ACTIVE Type: STORAGE ENGINE Library: NULL License: GPL ... URL: http://dev.mysql.com/doc/refman/5.5/en/show-plugins.html mysql> ? Transations; Nothing found Please try to run 'help contents' for a list of all accessible topics mysql> ? Transactions; You asked for help about help category: "Transactions" For more information, type 'help <item>', where <item> is one of the following topics: ISOLATION LOCK SAVEPOINT START TRANSACTION mysql>
通过帮助文档可以查询到mysql的所有命令及每个命令的功能,语法。
发表评论
-
mysql的复制设置详解
2013-06-18 09:44 1102原文链接:http://www.javaarch.ne ... -
MySQL Events详解
2013-06-06 12:28 729原文链接:http://www.javaarch.net/ ... -
分布式唯一主键生成策略的一种开销比较小的方法
2013-06-05 09:26 1259原文链接:http://www.javaarch.net/ ... -
Oracle删除重复记录的几种方式
2013-06-05 09:26 672原文链接:http://www.javaarch.net/ ... -
Oracle 11G 虚拟列 Virtual Column介绍
2013-06-04 09:31 1209原文链接:http://www.javaarch.net/ ... -
Oracle Skip Locked
2013-06-04 09:30 812原文链接:http://www.javaarch.net/ ... -
各个数据库获取随机列的语法
2013-06-04 09:30 642原文链接:http://www.javaarch.net/ ... -
如何重置mysql的密码
2013-06-04 09:30 686原文链接:http://www.javaarch.net/ ... -
使用Mysqldump 备份数据库
2013-06-04 09:29 684原文地址:http://www.javaarch.net/ ... -
MySQL 全文搜索支持
2013-06-03 00:06 598原文地址:http://www.javaarch.net/ ... -
怎么重置mysql的自增列
2013-06-03 00:06 691原文链接:http://www.javaarch.net/ ... -
使用ssd硬盘加速 mysql index查询
2013-05-30 18:28 1479使用ssd硬盘加速 mysql index查询 更 ... -
mysql修改表默认字符集可能带来的隐患
2013-05-29 13:28 1076原文链接:http://www.javaarch.net/j ... -
Mysql 5.5分区特性增强深度解析
2013-05-22 13:49 1443原文链接:http://www.javaarc ... -
mysql常用监控脚本命令列表
2013-04-07 09:15 1266#/bin/sh #检测mysql server是否 ... -
hsqldb源码分析系列6之事务处理
2013-01-20 15:20 1675在session的 public Result ... -
hsqldb源码分析系列5 查询引擎之查询操作
2013-01-18 17:27 2265执行过程先分析select语句的解析过程: ... -
hsqldb源码分析系列4 查询引擎之查询操作
2013-01-18 00:27 988查询过程前面解析类似insert,最终调用是在 ... -
hsqldb源码分析系列3 执行引擎分析 插入过程分析
2013-01-17 21:43 1339我们看看insert语句的执行过程, 如 ... -
hsqldb源码分析系列2 解析器分析
2013-01-17 17:22 1083在server类的handleC ...
相关推荐
mysql帮助文档帮助学习mysql数据库mysql帮助文档帮助学习mysql数据库mysql帮助文档帮助学习mysql数据库
MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最详细帮助文件MySQL的最...
MySQL帮助文档 大全,MySQL参考手册
网页版MySQL帮助文档
MySQL数据库使用帮助文档,在开发与数据库相关的Web应用程序时,一个较好的帮助文档手册。
mysql帮助文档
mysql5.1 chm 帮助文档 中文 mysql5.1 chm 帮助文档 中文
MySQL参考手册,比较全的。中文翻译版,日常编程设计中不可多得的资料,初学者建议入手
MySQL帮助文档.chm 绝对可用 适合新手阅读,其中包括 开发API 以及一些实力。绝对给力!
mysql8.0帮助文档,mysql8.0与之前版本的系统变量存在不小的差异,供学习使用
MySQL 使用帮助文档中文版,更符合观看要求。该内容详细易懂,可以为使用者提供相当大的帮助。
mysql的中文帮助文档,官方的 很有用的帮助,其中包括了大量的使用信息 和mysql的api接口 都有函数的功能介绍 加紧下载吧! 很难得哦
mysql中文帮助文档 mysql 帮助文档mysql中文帮助文档 mysql 帮助文档mysql中文帮助文档 mysql 帮助文档mysql中文帮助文档 mysql 帮助文档
MySQL中文API,MySQL中文帮助文档,chm版,帮助大家学习MySQL
mysql的帮助文档,介绍了从安装到应用的细节,适合初学者阅读
mysql5.1及mysql4.1帮助文档.chm.rar,两种全中文帮助文档!
易语言帮助文档MySql数据库例程
1.6.2. MySQL Community Support at the MySQL Forums 1.6.3. MySQL Community Support on Internet Relay Chat (IRC) 1.6.4. MySQL Enterprise 1.7. How to Report Bugs or Problems 1.8. MySQL Standards ...