How to obtain mysql help information and mysql help information

Source: Internet
Author: User
Tags mysql commands

How to obtain mysql help information and mysql help information

When a mysql-related fault occurs in the development or test environment, most of my friends may post on the Forum and discuss the problem with the QQ group. This method is one of the effective ways to get help. However, in a production environment without a network, these methods will not help solve the problem. Regardless of the database, obtaining help from the official website is the most direct and effective way. In the absence of a network environment, we can solve the problem through the help information provided by the MySQL client tool.

 

1) MySQL official manual
And Oracle official documentation, MySQL official manual is the most direct and effective way to get MySQL help. This Manual contains many parts, such as SQL syntax, MySQL installation method, MySQL System variables, status variables, common tools for command line, and database management. In short, it is a large collection of MySQL Data. Supports PDF and html downloads.

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

 

2) MySQL client tool's built-in help

Obtain mysql-related help information. Enter help at the mysql prompt to obtain help information about the mysql client. This method is similar to help in 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 products, visit: https://shop.mysql.com/List of all MySQL commands: Note that all text commands must be first on line and end ';'? (\?) Synonym for 'help '. clear (\ c) Clear the current input statement. -- clear the current input statement connect (\ r) Reconnect to the server. optional arguments are db and host. -- reconnect, which is usually used to remove a connection or disconnect the connection after an exception occurs. in SQL * plus, there is also such a connect command delimiter (\ d) Set statement delimiter. -- set the command Terminator. The default value is;. For example, we can set it to/to indicate that the statement ends edit (\ e) Edit command with $ EDITOR. -- edit the last SQL statement of the buffer to the file. By default, vi is called. The file will be placed in the/tmp path and ego (\ G) Send command to mysql server, display resu Lt vertically. -- The control result is displayed as vertical exit (\ q) Exit mysql. same as quit. -- exit mysqlgo (\ g) Send command to mysql server. -- send the command to mysql service help (\ h) Display this help. nopager (\ n) Disable pager, print to stdout. -- close the page settings and print it to the standard output notee (\ t) Don't write into outfile. -- disable pager (\ P) Set PAGER [to_pager]. print the query results via PAGER. -- set the pager mode. It can be set to call more, less, and so on. It is mainly used to display print (\ p) Print current command by page.. Prompt (\ R) Change your mysql prompt. -- change the mysql prompt quit (\ q) Quit mysql. rehash (#) Rebuild completion hash. -- automatically fills in the relevant object name source (\.) execute an SQL script file. takes a file name as an argument. -- execute the script file status (\ s) Get status information from the server. -- obtain the status information system (\!) Execute a system shell command. -- run the system command tee (\ T) Set outfile [to_outfile]. append everything into given outfile. -- The operation result is output to the file use (\ u) Use another database. takes database name as argument. -- Switch database charset (\ C) Switch to another charset. might be needed for processing binlog with multi-byte charsets. -- set the character set warnings (\ W) Show warnings after every statement. -- print the warning information nowarning (\ w) Don't show warnings After every statement. -- For all the commands above, the quick operation is included in the expansion number, that is, you only need to enter the "\" + letter to execute For server side help, type 'help CONTENTS' -- note that the description here help contents will get help information on the server side -- Demonstration section, demonstration of Common commands -- 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 with-AConnection id: 5 Current database: chardb -- set pagination, the display of an additional page will not stop rolling. You can use this command to set pagination and To call the system command mysql> pager more -- set to more mode PAGER set to 'more' mysql> select table_name, table_type, engine from information_schema.tables; -- the query will automatically roll over to mysql> pager tail-5 on the next screen after it is displayed on one screen; -- set PAGER set to 'Tail-5' at the end of the output to mysql> select table_name, table_type, engine from information_schema.tables; | setup_timers | base table | PERFORMANCE_SCHEMA | threads | base table | PERFORMANCE_SCHEMA | animals | BASE TABL E | InnoDB | shop | base table | InnoDB | + ---------------------------------------------- + --------------- + ---------------- + 92 rows in set (0.02 sec) mysql> pager; -- view the current pager settings PAGER set to 'Tail-5' mysql> nopager; -- switch to the standard (default) pager mode PAGER set to stdout -- tee command, output the log file mysql> tee/tmp/query. log -- enable output to file, which is equivalent to spoolLogging to file '/tmp/query in SQL * plus. log 'mysql> select table_name, table_type, engine from Information_schema.tables; + metric + ------------- + ------------------ + | table_name | table_type | engine | + metric + ------------- + metric + | CHARACTER_SETS | system view | MEMORY | COLLATIONS | system view | MEMORY |... .......... mysql> notee; -- close output to file, which is equivalent to spool offOutfile disabled under SQL * Plus. mysql> system ta Il/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 | + ------------------------------------------------ + ------------------------ + 92 rows in set (0.02 s Ec) -- change the mysql prompt mysql> PROMPT SessionA> prompt set to 'sessiona> '-- restore to the default prompt SessionA> PROMPT; returning to default PROMPT of mysql> -- execute the SQL script file mysql> system more query. SQL -- Note: 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) -- obtain the status information mysql> status; -------------- mysql Ver 14.14 Distrib 5.37, for Linux (x86_64) using readline 5.1 Connection id: 6 Current database: chardbCurrent user: root @ localhostSSL: not in useCurrent pager: lessUsing outfile: ''Using delimiter:; Server version: 5.5.37-log MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: utf8Client characterset: latin1Conn. characterset: latin1UNIX socket:/var/lib/mysql. sockUptime: 3 hours 10 min 59 secThreads: 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 changedmys Ql> \ s -------------- mysql Ver 14.14 Distrib 5.5.37, for Linux (x86_64) using readline 5.1 Connection id: 6 Current database: chardbCurrent user: root @ localhostSSL: Not in useCurrent pager: lessUsing outfile: ''Using delimiter:; Server version: 5.5.37-log MySQL Community Server (GPL) Protocol version: 10 Connection: Localhost via UNIX socketServer characterset: latin1Db characterset: utf8Client charact Erset: gbk --- both the client and the conn character set are changed to gbk. Conn. characterset: gbkUNIX socket:/var/lib/mysql. sockUptime: 3 hours 13 min 33 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 an 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 mysql> show warnings; + ------- + ------ + horizontal --------------------------- + | Level | Code | Message | + ------- + ------ + horizontal ----------------------------- + | Error | 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 'selecs 1' at line 1 | + ------- + ------ + response --------------------------- + 1 row in set (0.00 sec) mysql> show errors; + ------- + ------ + horizontal --------------------------- + | Level | Code | Message | + ------- + ------ + horizontal ----------------------------- + | Error | 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 'selecs 1' at line 1 | + ------- + ------ + response --------------------------- + 1 row in set (0.00 sec) mysql> nowarning; Show warnings disabled.


3. Server-related help

-- For help related to server management, enter help contentsmysql> help contents; You asked For help about help category: "Contents" for more information, type 'help <item> ', where <item> is one of the followingcategories: Account Management Administration Compound Statements Data Definition Data Manipulation Data Types Functions and Modifiers for Use with group by Geographic Features Help Metadata Language Structure Pl Ugins Procedures Storage Engines Table Maintenance Transactions User-Defined Functions ity -- to query the content of that part, enter the help + content directly, as shown in mysql> help administration; you asked for help about help category: "Administration" For more information, type 'help <item> ', where <item> is one of the followingtopics: binlog cache index flush query cache help command kill .......... -- next, we will view the flush command in the administration Section 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 reloadvarous internal caches, flush tables, or acquire locks. to executeFLUSH, you must have the RELOAD privilege. specific flush options mightrequire additional privileges, as described later. -- View cach E index help information mysql> help 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] [,...]... -- Summary: You can obtain detailed information related to the topic through step-by-step help. -- Author: Leshami -- Blog: History command, usually view system variables, status variables, and other mysql> help show; Name: 'show' Description: SHOW has signing forms that provide information about databases, tables, columns, or status information about the server. this section describesthose following: show authorsshow {BINARY | MASTER} LOGS -- sets system variables and uses 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 thataffect the operation of the server or your client. older versions ofMySQL employed set option, but this syntax is deprecated in favor ofSET without OPTION. URL: http://dev.mysql.com/doc/refman/5.5/en/set-statement.html



How to obtain the mysql version

Run Mysql-V directly on the command line to view the mysql version and release information.

How does mysql obtain the header information?

Use information_schema
Select * from columns where table_name = 'table name ';

Show columns from table name;

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.