HELP 'search_string'
HELP 语句从 MySQL 参考手册返回在线信息。其正常操作需要在 mysql 数据库中使用帮助主题信息初始化帮助表(参见 第 7.1.17 节,“服务器端帮助支持”)。The HELP statement returns online
information from the MySQL Reference Manual. Its proper operation
requires that the help tables in the mysql
database be initialized with help topic information (see
Section 7.1.17, “Server-Side Help Support”).
HELP 语句在帮助表中搜索给定的搜索字符串并显示搜索结果。搜索字符串不区分大小写。The HELP statement searches the
help tables for the given search string and displays the result of
the search. The search string is not case-sensitive.
搜索字符串可以包含通配符字符 % 和 _。这些字符在 LIKE 操作符的模式匹配操作中具有相同的含义。例如,HELP 'rep%' 返回以 rep 开头的主题列表。The search string can contain the wildcard characters
% and _. These have the same
meaning as for pattern-matching operations performed with the
LIKE operator. For example,
HELP 'rep%' returns a list of topics that begin
with rep.
HELP 语句不需要诸如 ; 或 \G 之类的结束符。The HELP statement does not require a
terminator such as ; or \G.
HELP 语句理解几种类型的搜索字符串:The HELP statement understands several types of
search strings:
在最一般的层面上,使用
contents来检索顶级帮助类别的列表:At the most general level, usecontentsto retrieve a list of the top-level help categories:HELP 'contents'
要列出给定帮助类别中的主题,例如
Data Types,请使用类别名称:For a list of topics in a given help category, such asData Types, use the category name:HELP 'data types'
要获取特定帮助主题的帮助,例如
ASCII()函数或CREATE TABLE语句,请使用相关的关键字:For help on a specific help topic, such as theASCII()function or theCREATE TABLEstatement, use the associated keyword or keywords:HELP 'ascii' HELP 'create table'
换句话说,搜索字符串可以匹配一个类别、多个主题或单个主题。下面的描述说明了结果集可能的形式。In other words, the search string matches a category, many topics, or a single topic. The following descriptions indicate the forms that the result set can take.
空结果Empty result
未找到与搜索字符串匹配的内容。No match could be found for the search string.
示例:
HELP 'fake'Example:HELP 'fake'产生:Yields:
Nothing found Please try to run 'help contents' for a list of all accessible topics
结果集包含单行Result set containing a single row
这意味着搜索字符串找到了一条匹配的帮助主题。结果包括以下内容:This means that the search string yielded a hit for the help topic. The result includes the following items:
name:主题名称。name: The topic name.description:该主题的描述性帮助文本。description: Descriptive help text for the topic.example:一个或多个使用示例。(可能为空。)example: One or more usage examples. (May be empty.)
示例:
HELP 'log'Example:HELP 'log'产生:Yields:
Name: 'LOG' Description: Syntax: LOG(X), LOG(B,X) If called with one parameter, this function returns the natural logarithm of X. If X is less than or equal to 0.0E0, the function returns NULL and a warning "Invalid argument for logarithm" is reported. Returns NULL if X or B is NULL. The inverse of this function (when called with a single argument) is the EXP() function. URL: https://docs.oracle.com/cd/E17952_01/mysql-8.4-en/mathematical-functions.html Examples: mysql> SELECT LOG(2); -> 0.69314718055995 mysql> SELECT LOG(-2); -> NULL主题列表。List of topics.
这意味着搜索字符串匹配了多个帮助主题。This means that the search string matched multiple help topics.
示例:
HELP 'status'Example:HELP 'status'产生:Yields:
Many help items for your request exist. To make a more specific request, please type 'help <item>', where <item> is one of the following topics: FLUSH SHOW SHOW BINARY LOG STATUS SHOW ENGINE SHOW FUNCTION STATUS SHOW PROCEDURE STATUS SHOW REPLICA STATUS SHOW STATUS SHOW TABLE STATUS
主题列表。List of topics.
如果搜索字符串匹配一个类别,也会显示列表。A list is also displayed if the search string matches a category.
示例:
HELP 'functions'Example:HELP 'functions'产生:Yields:
You asked for help about help category: "Functions" For more information, type 'help <item>', where <item> is one of the following categories: Aggregate Functions and Modifiers Bit Functions Cast Functions and Operators Comparison Operators Date and Time Functions Encryption Functions Enterprise Encryption Functions Flow Control Functions GROUP BY Functions and Modifiers GTID Information Functions Internal Functions Locking Functions Logical Operators Miscellaneous Functions Numeric Functions Performance Schema Functions Spatial Functions String Functions Window Functions XML