During theuse of mysq L, you may often encounter the following issues:
- Some operation syntax forgot, how to quickly find?
- How do I quickly know the range of values for a field type on the current version?
- What functions are supported in the current version? I hope there are examples to illustrate:
- Does the current version support a feature?
for the problems listed above, we might think of a way to find MySQL documents, which can be clearly found in official documents, but it takes a lot of time and effort.
so for these questions, the best solution is to use the MySQL installed after the help document, so that in case of problems can be easily and quickly query. view Help by HierarchyView Catalog If you do not know what help can provide, you can use the "? Contents" command to display all the categories available for querying, as shown in the following example:
Mysql>? Contentsyou asked for help in the category: "Contents" For more information, type ' help <item> ', where <ITEM&G T is one of the followingcategories: 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 procedures Storage Engines Table Maintenance Transactions user-defined Functions Utility
View Data Typesfor the categories listed, you can use the "?????????" method to make a further view of what the user is interested in, for example, to see what data types are supported by MySQL and to execute the "? Data tyeps" command:
Mysql>? Data typesyou asked for help on Help category: "Data Types" For more information, type ' help <item> ', where <it Em> is one of the followingtopics: 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
all the data types supported by this version are listed above, and if you want to know the specific description of the int type, you can also use the above method to do a further review:
Mysql>? Intname: ' INT ' description:int[(M)] [UNSIGNED] [zerofill]a normal-size Integer. The signed range is-2147483648 to 2147483647.The unsigned range are 0 to 4294967295.URL:HTTP://DEV.MYSQL.COM/DOC/REFMAN/5 .5/en/numeric-type-overview.html
View functions
Mysql>? Functionsyou asked for help in the category: "Functions" For more information, type ' help <item> ', where <item > is one of the followingcategories: Bit Functions Comparison operators Control flow Functions Date and time Functions encryption Functions information Functions Logical operators Miscellaneous Functions Numeric Functions String Functions
then look at the corresponding function according to the listed directory, for example, see what date function
Mysql>? Date and time Functionsyou asked for help on Help category: "Date and Time Functions" For more information, type ' Help & Lt;item> ', where <item> is one of the followingtopics: adddate addtime convert_tz curdate current_date Current_time current_timestamp curtime DATE FUNCTION DATEDIFF date_add date_format date_sub Day dayname dayofmonth DAYOFWEEK dayofyear EXTRACT from_days from_unixtime Get_format HOUR last_day localtime localtimestamp makedate maketime microsecond MINUTE MONTH MONTHNAME now period_add period_diff QUARTER SECOND sec_to_time str_to_date subdate Subtime sysdate time function timediff TIMESTAMP FUNCTION timestampadd Timestampdiff time_format time_to_sec to_days to_seconds unix_timestamp utc_date Utc_time Utc_timestamp WEEK WEEKDAY weekofyear year Yearweek
Quick Check Helpin practical applications, you can use keywords for quick queries if you need to quickly review a grammar. For example, to know what the show command can see, use the following command:
Mysql>? ShowName: ' SHOW ' description:show have many forms that provide information about databases, tables,columns, or status Inform ation about the server. This section describesthose following:show authorsshow {BINARY | MASTER} logsshow BINLOG EVENTS [in ' Log_name '] [from POS] [LIMIT [offset,] row_count]show CHARACTER SET [Like_or_where]sho W COLLATION [Like_or_where]show [Full] COLUMNS from Tbl_name [from db_name] [like_or_where]show contributorsshow CREATE DA Tabase db_nameshow Create EVENT event_nameshow Create FUNCTION func_nameshow Create PROCEDURE proc_nameshow create TABLE t Bl_nameshow Create TRIGGER trigger_nameshow Create VIEW view_nameshow DATABASES [like_or_where]show ENGINE engine_name {S Tatus | Mutex}show [STORAGE] enginesshow ERRORS [LIMIT [offset,] row_count]show eventsshow function CODE func_nameshow function ST ATUs [like_or_where]show GRANTS for Usershow INDEX from Tbl_name [from Db_name]show MASTER statusshow OPEN TABLES [from DB _name] [Like_or_where]show pluginsshow PROCEDURE CODE proc_nameshow PROCEDURE STATUS [Like_or_where]show privilegesshow [Full] processlistshow profile [types] [ For QUERY n] [OFFSET n] [LIMIT n]show profilesshow SLAVE hostsshow SLAVE statusshow [GLOBAL | SESSION] Status [like_or_where]show TABLE status [from db_name] [like_or_where]show [Full] TABLES [from db_name] [like_or_ Where]show TRIGGERS [from db_name] [like_or_where]show [GLOBAL | SESSION] VARIABLES [like_or_where]show WARNINGS [LIMIT [offset,] row_count]like_or_where:like ' pattern ' | WHERE Exprif The syntax for a given SHOW statement includes a like ' pattern ' part, ' pattern ' was a string that can contain t He SQL "%" and "_" wildcard characters. The pattern is useful-restricting statementoutput to matching values. Several SHOW Statements also accept a WHERE clause that provides moreflexibility in specifying which rows to display. Seehttp://dev.mysql.com/doc/refman/5.5/en/extended-show.html.url:http://dev.mysql.com/doc/refman/5.5/en/show.html
view a function concat use
mysql> concatname: ' CONCAT ' Description:Syntax:CONCAT (str1,str2,...) Returns the string that results from concatenating the arguments. Mayhave one or more arguments. If all arguments be nonbinary strings, Theresult is a nonbinary string. If the arguments include any binarystrings, the result is a binary string. A numeric argument is convertedto its equivalent string form. This is a nonbinary string as of MySQL5.5.3. Before 5.5.3, it is a binary string; To-avoid that andproduce a nonbinary string, you can use the a explicit type cast, as Inthis example:select CONCAT (CAST (in T_col as CHAR), Char_col); CONCAT () returns null if any argument is null. url:http://dev.mysql.com/doc/refman/5.5/en/string-functions.htmlexamples:mysql> SELECT CONCAT (' My ', ' S ', ' QL '); ' MySQL ' mysql> SELECT CONCAT (' My ', NULL, ' QL '); -Nullmysql> SELECT CONCAT (14.3); ' 14.3 '
For example, if you want to see the syntax for
CREATE TABLE , you can use the following command:
Mysql>? Create TableName: ' 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_statementor:create [temporary] TABLE [IF not EXISTS] tbl_name {like Old_tbl_name | (like Old_tbl_name)} ......
One more example, like to see how to write the
user grant syntax.
Mysql>? Grantname: ' GRANT ' Description:Syntax:GRANT priv_type [(column_list)] [, Priv_type [(column_list]]] ... On [object_type] priv_level to user_specification [, user_specification] ... [REQUIRE {NONE | ssl_option [[and] ssl_option] ...}] [With With_option ...] GRANT PROXY on User_specification to User_specification [, user_specification] ... [With GRANT option]object_type: TABLE | FUNCTION | PROCEDURE ...
Here is the View manual and official information of the address presented, the mantle is passed to you, don't forget to give a praise Oh ~
Common network resources http://dev.mysql.com/downloads/is the official MySQL website that can be downloaded to various versions of MySQL and related client development tools.http://dev.mysql.com/doc/provides an online handbook of the most authoritative MySQL databases and tools available today. http://bugs.mysql.com/can see a list of bugs that have been published by MySQL, or submit bug reports to MySQL http://www.mysql.com/news-and-events/newsletter/usually publishes a variety of latest news about MySQL.
How to view MySQL Help documentation efficiently