How to get MySQL Help information

Source: Internet
Author: User
Tags mysql commands mysql manual readline

In the development or testing environment when encountering MySQL-related failures, most friends may be posted through the Forum, QQ group discussion method to get help. This approach is one of the effective ways to get help. However, in the production environment, in the absence of the network environment, these methods will not help solve the problem. No matter what kind of database, getting help from the official website is the most direct and effective way. Second, there is no network environment, we can use the MySQL client tool to bring the help information to solve the problem.

1) Official MySQL manual
and Oracle Official documentation, the official MySQL manual is the most direct and effective way to get MySQL help. The manual contains a number of sections, such as syntax for SQL, MySQL installation, MySQL system variables, state variables, command line common tools, database tubes, and so on. Anyway, it's a MySQL data-related collection. Support PDF and HTML download.

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

2) MySQL client tool comes with help

Get help on MySQL, and enter help directly at the MySQL prompt for assistance with MySQL client-related information. This approach is similar to the Help under Oracle Sql*plus. mysql> helpfor information about MySQL products and services, visit:http://www.mysql.com/for developer information, Including the MySQL Reference Manual, visit:http://dev.mysql.com/to buy MySQL Enterprise support, training, or other PR Oducts, visit:https://shop.mysql.com/list of all MySQL commands:note the all text commands must is first on line and E            nd with '; '         ? (\?) Synonym for ' help '.                             Clear (\c) Clear the current input statement. --Clears the current input statement connect (\ r) reconnect to the server.   Optional arguments is DB and host.                                       --reconnect, usually used to be removed or re-connected after an abnormal disconnection, there is also a connect command delimiter (\d) Set statement delimiter under Sql*plus.                                     --Set the command terminator, by default, for example, we can set to/to indicate statement end Edit command with $EDITOR. \e. --Edit the previous SQL statement of the buffer to the file, the default call VI, the file will be placed in the/tmp path under ego (\g) Send command to MySQL server, Display result vertically. --control results are displayed as vertical display exit (\q) exit MySQL.                                      Same as quit.                                  --Exit Mysqlgo (\g) Send command to MySQL server.                                --Send command to MySQL service Help (\h) Display this help.nopager (\ n) Disable Pager, print to stdout.                                      --Turn off page setup, 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 pagination display print (\p) print current command.                                      Prompt (\ r) Change your MySQL prompt.                                                          --Change the MySQL prompt for quit (\q) quit MySQL.                                       Rehash (\#) Rebuild completion hash. --auto-Completion related object name source (\.) Execute an SQL script file.  Takes a file name as an argument. --Execute 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 results output to file use (\u) with another database.         Takes database name as argument. --Switch Database charset (\c) switch to another charset.  Might is needed for processing binlog with Multi-Byte charsets.                           --Set the character set warnings (\w) Show warnings after every statement. --Print warning message nowarning (\w) Don ' t show warnings after every statement.--all commands above, within the expansion number for the quick action, that is, only need to enter "\" + Letters to execute for server side hel p, type ' help Contents '--note the description here helps contents will get the server-side helpful information--Demo section, demo common Command--connect command mysql> connect chardb localhost ; Reading table information for completion of table and column namesyou can turn off this feature to get a quicker startup W   Ith-aconnection id:5current database:chardb--Set paging, in excess of a page display will not stop tumbling, with this command can set the paging, set to invoke system command mysql> pager more        --set to the more mode pager set to ' More ' mysql> select Table_name,table_type,engine from Information_schema.tables;       --the query will exceed one screen display after pressing the SPACEBAR will automatically roll to the next screen mysql> pager tail-5; --Set output trailing 5 lines 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 |+----------------------------------------------+-------------+--------------------+92 rows in Set (0.0                2 sec) mysql> Pager;              --View current pager settings pager set to ' tail-5 ' mysql> nopager; --Switch to standard (default) pager mode pager set to stdout--tee command, output log file mysql> Tee/tmp/query.log--open output to file, equivalent to Sql*plus spoollogging to file '/tmp/query.log ' mysql> SelectTable_name,table_type,engine from information_schema.tables;+----------------------------------------------+---- ---------+--------------------+| table_name | Table_type | Engine |+----------------------------------------------+-------------+--------------------+| Character_sets | SYSTEM VIEW | MEMORY | | Collations | SYSTEM VIEW |       MEMORY |                                .............mysql> notee; --Close output to file, equivalent to spool offoutfile disabled.mysql> system Tail/tmp/query.log under Sql*plus--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 |+----------------------------------------------+-------------+--------------------+92 rows in Set (0.0 2 sec)--change MySQL 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 Chardbselect * from Tb_isam;mysql> Source query.sqlreading table information for completion of table and column namesyou can turn off this feature to get a quicker startup with-adatabase changed+------+-------+| ID |    Value |+------+-------+| 1 |    A | | 2 |    B | | 3 |    C | | 4 |  F |+------+-------+4 rows in Set (0.00 sec)-Get status information mysql> state;--------------MySQL Ver 14.14 distrib 5.5.37, for      Linux (x86_64) using ReadLine 5.1Connection id:6current database:chardbcurrent User:     [Email protected] Ssl:not in Usecurrent pager:lessusing outfile: ' Using delimiter:;  Server Version:5.5.37-log MySQL Community Server (GPL) Protocol Version:10connection:localhost  Via UNIX socketserver characterset:latin1db characterset:utf8client characterset:latin1conn. Characterset:latin1unix socket:/var/lib/mysql/mysql.sockuptime:3 hours min secthrea Ds:1 questions:97 Slow queries:0 opens:313 Flush tables:1 Open tables:51 queries per second avg:0.008-------- --------Modify the client character set mysql> charset GBK; Charset changedmysql> \s--------------mysql Ver 14.14 distrib 5.5.37, for Linux (x86_64) using ReadLine 5.1Connection Id:6current database:chardbcurrent User: [Email protected]ssl:not in U Securrent pager:lessusing outfile: ' Using delimiter:;     Server version:    5.5.37-log MySQL Community Server (GPL) Protocol version:10connection:localhost via UNIX socketserv The ER characterset:latin1db characterset:utf8client CHARACTERSET:GBK---Client and conn-side character set have become GBK.  Conn.  Characterset:gbkunix socket:/var/lib/mysql/mysql.sockuptime:3 hours min secthreads: 1 questions: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-corresponds to your MySQL server version for the right syntax-use near ' selecs 1 ' at line 1mysql& Gt Show warnings;+-------+------+--------------------------------------------------------------------------------- ---------------------------------------------------------------------------+| Level | Code |                                                           Message                                                                                         |+-------+------+---------------- --------------------------------------------------------------------------------------------------------------- -----------------------------+| Error | 1064 | You have a error in your SQL syntax; Check the manual-corresponds to your MySQL server version for the right syntax-use-near ' selecs 1 ' on 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-corresponds to your MySQL server version for the right syntax-use-near ' selecs 1 ' on line 1 |+--- ----+------+--------------------------------------------------------------------------------------------------- ---------------------------------------------------------+1 Row in Set (0.00 sec) mysql> nowarning; Show warnings disabled.


3, Help on the server

--Get help with Server management and enter the assistance contentsmysql> contents; You asked to help in the category: "Contents" For more information, type ' help <item> ', where <item> was on E of the Followingcategories:account Management administration Compound Statements Data Definition data Manipul ation Data Types Functions Functions and Modifiers for use with GROUP by geographic Features help Metadata Lan guage Structure Plugins Procedures Storage Engines Table maintenance transactions user-defined Functions Uti lity--to query that part of the content, directly enter help + content, as follows mysql> help administration;  You asked-Help on Help Category: "Administration" For more information, type ' help <item> ', where <item> is one of the Followingtopics:binlog cache INDEX flush Flush QUERY CACHE help COMMAND KILL ...-Next , 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, clear or reloadvarious internal caches, flush tables, or acquire locks. To Executeflush, you must has the RELOAD privilege.      Specific flush Options Mightrequire additional privileges, as described later. --View the Help information for the cache index mysql>-assist cache index;  Name: ' CACHE index ' Description:Syntax:CACHE index tbl_index_list [, Tbl_index_list] ... [PARTITION (Partition_list | All)] in key_cache_nametbl_index_list:tbl_name [[index| KEY] (index_name[, index_name] ...)  partition_list:partition_name[, partition_name][, ...]  ...-summarize, that is, through step-by-step help, you can get more detailed information about the subject matter of the topic. --author:leshami--blog:http://blog.csdn.net/leshami--more commonly used show commands, usually look at system variables, state variables, etc. mysql> help show; Name: ' SHOW ' description:show have many forms that provide information about databases, tables,columns, or status Informatio n about the server. This section describesthose following:show authorsshow {BINARY | MASTER} logs--Set system variables, using the SET command mYsql> help set;  Name: ' SET ' Description:Syntax:SET variable_assignment [, variable_assignment] ... variable_assignment:user_var_name = Expr | [GLOBAL | SESSION] System_var_name = Expr | [@ @global. @ @session. | @@]system_var_name = exprthe SET statement assigns values to different types of variables Thataf Fect the operation of the server or your client. Older versions ofmysql employed SET option, but the this syntax was deprecated in favor ofset without option. Url:http://dev.mysql.com/doc/refman/5.5/en/set-statement.html


How to get MySQL Help information

Related Article

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.