Pre-General Availability: 2023-01-18
To process MySQL Shell commands:
Select the active language by entering:
\py to make Python the active language.
\sql to make SQL the active language.
Not all commands show an output.
MySQL Shell provides commands which enable you to modify the execution environment.
The following table lists the commands that are available regardless of the currently selected language. As commands need to be available independent of the processing mode, they start with an escape sequence, the \ character.
|\help||\h or \?||Print help about MySQL Shell, or search the online help.|
|\quit||\q or \exit||Exit MySQL Shell.|
|\||In SQL mode, begin multiple-line mode. Code is cached and executed when an empty line is entered.|
|\status||\s||Show the current MySQL Shell status.|
|\py||Switch mode to Python.|
|\sql||Switch mode to SQL.|
|\connect||\c||Connect to a MySQL instance.|
|\reconnect||Reconnect to the same MySQL instance.|
|\disconnect||Disconnect the global session.|
|\use||\u||Specify the schema to use.|
|\source||\. or source (no backslash)||Process a script file using the active language.|
|\warnings||\W||Show any warnings generated by a statement.|
|\nowarnings||\w||Do not show any warnings generated by a statement.|
|\history||View and edit command history.|
Manually update the autocomplete name cache.
|\option||Query and change MySQL Shell configuration options.|
|\show||Run the specified report using the provided options and arguments.|
|\watch||Run the specified report using the provided options and arguments, and refresh the results at regular intervals.|
|\edit||\e||Open a command in the default system editor then present it in MySQL Shell.|
|\pager||\P||Configure the pager which MySQL Shell uses to display text.|
Disable any pager which MySQL Shell was configured to use.
Run the specified operating system command and display the results in MySQL Shell.
The \source command does not function as expected.
When attempting to use the \source command, you must note that Visual Studio Code is a web environment that does not permit direct disk access. Therefore, although listed in the help options, it is difficult to process a script using the \source command.