Mysql Help Command (helping information) Chinese annotation _mysql

Source: Internet
Author: User
Tags close page flush mysql client mysql commands readline

In the development or test environment in the face of MySQL-related failures, most friends may be through the forum post, QQ group discussion way to get help. This approach is one of the effective ways to get help. However, in the production environment, in the absence of network environment, these methods will not help solve the problem. Whatever the database, getting help from the official web site is the most direct and effective way. Second, there is no network environment, we can use the MySQL client tools to bring the help information to solve the problem.

1 Official MySQL Handbook

and Oracle official documentation, the MySQL official manual is the most direct and efficient way to get MySQL help. The manual contains a number of sections, such as SQL syntax, MySQL installation, MySQL system variables, state variables, command line tools, database tubes, and so on. In short, a MySQL data-related Dahe set. PDF and HTML downloads are supported.

Download location: http://dev.mysql.com/doc/

2 MySQL client tools with help

For information about MySQL help, enter help directly at the MySQL prompt for information related to the MySQL client.
This approach is similar to the Help under Oracle Sql*plus. Mysql> Help for information about MySQL products and services, visit:http://www.mysql.com/for developer Informatio N, including the MySQL Reference Manual, visit:http://dev.mysql.com/to buy MySQL Enterprise support, training, or othe R products, visit:https://shop.mysql.com/list of all MySQL commands:note so all text commands must is      
E and end with '; '     ? (\?) 
Synonym for ' help '.               Clear (\c) Clear the current input statement. --Clears the currently entered statement connect (\ r) reconnect to the server.  Optional arguments are DB and host.                    --reconnect, usually used to be removed or reconnected after the abnormal disconnect, Sql*plus also has such a connect command delimiter (\d) Set statement delimiter.                   --Set the command terminator by default;, for example, we can set to/to represent the statement end Edit \e Edit command with $EDITOR.    --Edit the previous SQL statement of the buffer to the file, the default call VI, the file will be placed under the/tmp path ego (\g) Send command to MySQL server, display result vertically. --control results displayed as vertical exit (\q) Exit MySQL.                   Same as quit.                 --Exit MySQL Go (\g) Send command to MySQL server.
--Send command to MySQL service Help (\h) Display this help.                Nopager (\ n) Disable Pager, print to stdout.                   --Close Page setup and print to standard output notee (t) Don T write into outfile. --Turn off output to file pager (\p) Set Pager [To_pager].    Print the query results via PAGER.           
--Set pager mode, can be set to call More,less, and so on, mainly for paging display print (\p) print current command.                   Prompt (\ r) Change your MySQL prompt.                             
--Change the MySQL prompt quit (\q) quit MySQL.                    Rehash (\#) Rebuild completion hash. --Automatic completion of related object name source (\.) Execute an SQL script file. Takes a file name as an argument.            --Executes the script file status (\s) Get status information from the server. --Get status information System (\!)                Execute a system shell command. --Execute system command tee (\ t) Set outfile [To_outfile]. Append everything into given outfile.--operation result output to file use (\u) use AnotHer database.     Takes database name as argument. --Switch Database charset (\c) switch to another charset. Might be needed to processing binlog with Multi-Byte charsets.              --Set the character set warnings (\w) show warnings after every statement.
--Print warning messages nowarning (\w) Don ' t show warnings after every statement. --all of the above commands, within the extension of the shortcut operation, that only need to enter the "\" + Letter to execute for server side assistance, type ' help contents '-Note that here the description Help contents will get the server side of the relevant information-
-Demo section, demo common Command--connect command mysql> connect chardb localhost; Reading table information for completion of table and column names you can turn off this feature to get a quicker startup      With-a Connection id:5 Current Database:chardb--set paging and roll over when an extra page is displayed, with this command to set paging, set to invoke system commands mysql> pager more  --set to the more way PAGER set to ' More ' mysql> select Table_name,table_type,engine from Information_schema.tables;    --The query will go beyond a screen display and press the SPACEBAR will automatically roll to the next screen mysql> pager tail-5; --Set Output tail 5 line PAGER set to ' tail-5 ' mysql> select Table_name,table_type,engine from Information_schemA.tables; | Setup_timers | BASE TABLE | Performance_schema | | Threads | BASE TABLE | Performance_schema | | Animals | BASE TABLE | InnoDB | | Shop | BASE TABLE |
InnoDB | +----------------------------------------------+-------------+--------------------+ 0.02 in Set (SEC) MySQL        > pager;       --View current PAGER settings PAGER set to ' tail-5 ' mysql> nopager;
--Switch to the standard (default) PAGER mode PAGER set to stdout--tee command, output log file mysql> Tee/tmp/query.log--open output to file, quite with sql*plus under spool
Logging to file '/tmp/query.log ' mysql> select Table_name,table_type,engine from Information_schema.tables; +----------------------------------------------+-------------+--------------------+
| table_name | Table_type |
Engine | +----------------------------------------------+-------------+--------------------+
| Character_sets | SYSTEM VIEW | MEMORY | |          Collations        | SYSTEM VIEW |
    MEMORY |                ... mysql> notee, and so on.
--Close the output to a file, equivalent to the spool off outfile disabled under Sql*plus. mysql> System Tail/tmp/query.log--View the output log file | Setup_consumers | BASE TABLE | Performance_schema | | setup_instruments | BASE TABLE | Performance_schema | | Setup_timers | BASE TABLE | Performance_schema | | Threads | BASE TABLE | Performance_schema | | Animals | BASE TABLE | InnoDB | | Shop | BASE TABLE |
InnoDB | +----------------------------------------------+-------------+--------------------+ rows in Set (0.02 sec)--Change Mys
QL prompt mysql> prompt sessiona> prompt set to ' sessiona> '-revert to default prompt sessiona> prompt; Returning to default PROMPT of mysql>-Execute SQL script file mysql> system more Query.sql-note that this is the current directory use CHARDB select * F
Rom Tb_isam; mysql> Source Query.sql Reading table information for CompletioN of table and column names you can turn out this feature to get a quicker startup with-a Database changed +------+----- --+
| ID |
Value |  +------+-------+
| 1 |  A | | 2 |  B | | 3 |  C | | 4 |
f |
+------+-------+ 4 rows in Set (0.00 sec)--Get state information mysql> status; --------------MySQL Ver 14.14 distrib 5.5.37, for Linux (x86_64) using ReadLine 5.1 Connection id:6 current Databas E:chardb current User:root@localhost Ssl:not the Using outfile: ' Usin
G delimiter:; Server Version:5.5.37-log MySQL Community Server (GPL) Protocol version:10 Connection:localhost via UNIX s Ocket Server characterset:latin1 Db characterset:utf8 Client characterset:latin1 Conn. Characterset:latin1 UNIX Socket:/var/lib/mysql/mysql.sock uptime:3 hours sec threads:1 questions:97 Slow queries:0 Ope ns:313 Flush tables:1 Open tables:51 Queries per second avg:0.008----------------Modified GuestUser-end Character set mysql> charset GBK; Charset changed mysql> \s--------------mysql Ver 14.14 distrib 5.5.37, for Linux (x86_64) using ReadLine 5.1 Connect Ion Id:6 current Database:chardb current user:root@localhost ssl:not in use current Pager:le
SS using outfile: ' Using delimiter:; Server Version:5.5.37-log MySQL Community Server (GPL) Protocol version:10 Connection:localhost via UNIX s
Ocket Server characterset:latin1 Db CHARACTERSET:UTF8 client CHARACTERSET:GBK---Clients and conn-end character sets are GBK. Conn. CHARACTERSET:GBK UNIX Socket:/var/lib/mysql/mysql.sock uptime:3 hours min sec threads:1 Que stions:105 Slow queries:0 opens:313 Flush tables:1 Open tables:51 queries per second avg:0.009--------------MySQL
> warnings;
Show warnings enabled.
mysql> Selecs 1; Error 1064 (42000): You have a error in your SQL syntax; Check the manual that corresponds to your MySQL server version for the right syntax to Use near ' selecs 1 ' in line 1 mysql> show warnings; +-------+------+----------------------------------------------------------------------------------------------- -------------------------------------------------------------+
| Level | Code |
message | +-------+------+----------------------------------------------------------------------------------------------- -------------------------------------------------------------+
| Error | 1064 | You have a error in your SQL syntax;
Check the manual that corresponds to your MySQL server version for the right syntax to use near ' selecs 1 ' at line 1 | +-------+------+-----------------------------------------------------------------------------------------------
-------------------------------------------------------------+ 1 row in Set (0.00 sec) mysql> Show errors; +-------+------+------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Level | Code |
message | +-------+------+----------------------------------------------------------------------------------------------- -------------------------------------------------------------+
| Error | 1064 | You have a error in your SQL syntax;
Check the manual that corresponds to your MySQL server version for the right syntax to use near ' selecs 1 ' at line 1 | +-------+------+-----------------------------------------------------------------------------------------------
-------------------------------------------------------------+ 1 row in Set (0.00 sec) mysql> nowarning; Show warnings disabled.

3, server-side related help

--Get server management-related help, input assistance contents mysql> assist contents; Asked for help category: "Contents" For more information, type ' help <item> ', where <item> is O NE of the following Categories:account Management administration compound statements Data Definition data Manip Ulation Data Types functions functions and modifiers for use with GROUP by geographic Features help Metadata L Anguage Structure Plugins Procedures Storage engines Table maintenance transactions user-defined functions U
Tility--to query that part of the content, directly input help + content, as follows mysql> help administration; You are asked for help category: "Administration" For more information, type ' help <item> ', where <item&gt ; is one of the following Topics:binlog cache INDEX FLUSH FLUSH QUERY cache help COMMAND KILL ...--Then
Down, we look at the flush command usage under the Administration section, enter help flush directly, and mysql> help flush; Name: ' FLUSH ' Description:Syntax:FLUSH [No_write_to_binlog | LOcal] flush_option [, flush_option] ... The FLUSH statement has several variant forms that clear or reload various, internal caches, FLUSH tables, or acquire locks . To execute FLUSH, you must have the RELOAD privilege.   

Specific flush options might require additional privileges, as described later.
--View the cache index Help information mysql> helps cache index;
 Name: ' CACHE index ' Description:Syntax:CACHE index tbl_index_list [, Tbl_index_list] ... [PARTITION (Partition_list | All)] in Key_cache_name tbl_index_list:tbl_name [[index|

KEY] (index_name[, index_name] ...)]
 partition_list:partition_name[, partition_name][, ...] ...--To sum up, the details related to their subject are obtained by means of help-step-by-step-help method.)

--author:leshami--blog: <a target= "_blank" href= "Http://blog.csdn.net/leshami" >http://blog.csdn.net/leshami
</a>--more commonly used show commands, usually look at system variables, state variables such as mysql> help; Name: ' Show ' description:show has many forms that provide information about databases, tables, columns, or status Informa tion AboUT the server. This section describes those following:show AUTHORS show {BINARY |
MASTER} LOGS--Sets the system variable, mysql> help set with the SET command; Name: ' SET ' Description:Syntax:SET variable_assignment [, variable_assignment] ... Variable_assignment:user_var_nam E = Expr | [GLOBAL | Session] System_var_name = Expr | 
[@ @global. | @ @session. | @@]system_var_name = expr The SET statement assigns values to different types of variables affect the operation of the server or your client.

Older versions of MySQL employed set option, but this syntax was deprecated in favor of of set without option. Url:http://dev.mysql.com/doc/refman/5.5/en/set-statement.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.