Documentation Home
MySQL 8.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 37.9Mb
PDF (A4) - 37.9Mb
PDF (RPM) - 33.0Mb
HTML Download (TGZ) - 8.0Mb
HTML Download (Zip) - 8.1Mb
HTML Download (RPM) - 6.9Mb
Man Pages (TGZ) - 132.9Kb
Man Pages (Zip) - 189.5Kb
Info (Gzip) - 3.4Mb
Info (Zip) - 3.4Mb
Excerpts from this Manual

MySQL 8.0 Reference Manual  /  ...  /  mysqlsh — The MySQL Shell

4.5.7 mysqlsh — The MySQL Shell

MySQL Shell is an advanced command-line client and code editor for MySQL. In addition to SQL, MySQL Shell also offers scripting capabilities for JavaScript and Python. For information about using MySQL Shell, see Chapter 19, MySQL Shell User Guide. When MySQL Shell is connected to the MySQL Server through the X Protocol, the X DevAPI can be used to work with both relational and document data, see Chapter 20, Using MySQL as a Document Store. MySQL Shell includes the AdminAPI that enables you to work with InnoDB cluster, see Chapter 21, InnoDB Cluster.

mysqlsh supports the following command-line options.

Table 4.14 mysqlsh Options

Format Description Introduced
--auth-method Authentication method to use
--classic Deprecated in version 8.0.3. Create a ClassicSession
--cluster Connect to an InnoDB cluster 8.0.4
--database The schema to use (alias for --schema)
--dba Enable X Protocol on connection with server
--dbpassword Password to use when connecting to server
--dbuser MySQL user name to use when connecting to server
--execute Execute the command and quit
--file File to process in Batch mode
--force Continue in SQL and Batch modes even if errors occur
--get-server-public-key Request RSA public key from server
--help Display help message and exit
--host Connect to MySQL server on given host
--interactive Emulate Interactive mode in Batch mode
--javascript, --js Start in JavaScript mode
--json Print output in JSON format
--log-level Specify logging level
-ma Detect session protocol automatically 8.0.3
--mysql, -mc Create a session using MySQL protocol 8.0.3
--mysqlx, -mx Create a session using X Protocol 8.0.3
--name-cache Enable automatic loading of table names based on the active default schema 8.0.4
--no-name-cache Disable autocompletion. 8.0.4
--no-password No password is provided for this connection
--no-wizard, --nw Disable the connection wizard
--node Deprecated in version 8.0.3. Create a NodeSession
--password Password to use when connecting to server (alias for --dbpassword)
--passwords-from-stdin Read the password from stdin
--port TCP/IP port number for connection
--py, --python Start in Python mode
--recreate-schema Drop and recreate schema
--redirect-primary Ensure connection to an InnoDB cluster's primary 8.0.4
--redirect-secondary Ensure connection to an InnoDB cluster's secondary
--schema The schema to use
--server-public-key-path Path name to file containing RSA public key
--show-warnings Show warnings after each statement if there are any (in SQL mode)
--socket For connections to localhost, the Unix socket file to use, or pipe name on Windows (ClassicSessions only)
--sql Start in SQL mode
--sqlc Start in SQL mode using a ClassicSession
--sqln Deprecated in version 8.0.3. Start in SQL mode using a NodeSession
--sqlx Start in SQL mode using an X Protocol connection 8.0.3
--ssl Enable an SSL connection. Deprecated in version 1.0.10; use --ssl-mode instead.
--ssl-ca File that contains list of trusted SSL Certificate Authorities
--ssl-capath Directory that contains trusted SSL Certificate Authority certificate files
--ssl-cert File that contains X509 certificate
--ssl-cipher Name of the SSL cipher to use
--ssl-crl File that contains certificate revocation lists
--ssl-crlpath Directory that contains certificate revocation list files
--ssl-key File that contains X509 key
--ssl-mode Security state of connection to server
--table Display output in tabular format
--tls-version Protocols permitted for encrypted connections
--uri Session information in URI format
--user MySQL user name to use when connecting to server (alias for --dbuser)
--version Display version information and exit
--vertical Display all SQL results vertically


User Comments
Sign Up Login You must be logged in to post a comment.