MySQL CLI: Using Help
HELP Statement
mysql> help 'search string'
The HELP statement returns online information from the MySQL Reference Manual. 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.
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.
The HELP statement understands several types of search strings:
- At the most general level, use contents to retrieve a list of the top-level help categories:
mysql> help 'contents'
- For a list of topics in a given help category, such as Data Types, use the category name:
mysql> help 'data types'
- For help on a specific help topic, such as the ASCII() function or the CREATE TABLE statement, use the associated keyword or keywords:
mysql> help 'ascii'
mysql> help 'create table'
In other words, the search string matches a category, many topics, or a single topic. You cannot necessarily tell in advance whether a given search string will return a list of items or the help information for a single help topic. However, you can tell what kind of response HELP returned by examining the number of rows and columns in the result set.
The following descriptions indicate the forms that the result set can take. Output for the example statements is shown using the familiar “tabular” or “vertical” format that you see when using the MySQL CLI, but note that MySQL CLI itself reformats HELP result sets in a different way.
- Empty result set No match could be found for the search string.
- Result set containing a single row with three columns
This means that the search string yielded a hit for the help topic. The result has three columns:- name: The topic name.
- description: Descriptive help text for the topic.
- example: Usage example or examples. This column might be blank. Examples:
mysql> help 'replace'
mysql> help 'time%'
mysql> help '%unix%'