After you have installed and started MySQL server, connect MySQL Shell to the server instance. By default, MySQL Shell connects using X Protocol.
On the same system where the server instance is running, open a terminal window and start MySQL Shell with the following command:
mysqlsh name@localhost/world_x --py Creating a Session to name@localhost/world_x Enter password: ****
You may need to specify the path as appropriate.
namerepresents the user name of your MySQL account.
MySQL Shell prompts you for your password.
--pyoption starts MySQL Shell in Python mode. If you omit
The default schema for this session is the
world_xdatabase. For instructions on setting up the
world_xdatabase sample, see Section 20.4.2, “Import Database Sample”.
mysql-py> prompt indicates that the
active language for this session is Python.
When you run mysqlsh without the host argument, MySQL Shell attempts to connect to the server instance running on the localhost interface on port 33060. To specify a different host or port number, as well as other options, see the option descriptions at mysqlsh — The MySQL Shell.
MySQL Shell supports input-line editing as follows:
left-arrow and right-arrow keys move horizontally within the current input line.
up-arrow and down-arrow keys move up and down through the set of previously entered lines.
Backspace deletes the character before the cursor and typing new characters enters them at the cursor position.
Enter enters the current input line.
Type mysqlsh --help at the prompt of your command interpreter for a list of command-line options.
\help at the MySQL Shell prompt for a
list of available commands and their descriptions.
\help followed by a command name for
detailed help about an individual MySQL Shell command. For
example, to view help on the
mysql-py> \help \connect