MySQL Shell 8.0 (part of MySQL 8.0)

A.1 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 MySQL Shell 8.0 (part of MySQL 8.0). 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 Using MySQL as a Document Store. MySQL Shell includes the AdminAPI that enables you to work with InnoDB cluster, see InnoDB Cluster.

Many of the options described here are related to connections between MySQL Shell and a MySQL Server instance. See Section 4.2, “MySQL Shell Connections” for more information.

mysqlsh supports the following command-line options.

Table A.1 mysqlsh Options

Option Name Description Introduced
--auth-method Authentication method to use
--cluster Connect to an InnoDB cluster 8.0.4
--compress Compress all information sent between client and server 8.0.14
--connect-timeout Connection timeout for global session 8.0.13
--database The schema to use (alias for --schema)
--dba Enable X Protocol on connection with MySQL 5.7 server
--dba-log-sql Log SQL statements that are executed by AdminAPI operations 8.0.18
--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 Host on which MySQL server is located
--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
--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
--quiet-start Start without printing introductory information
--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
--result-format Set the output format for this session 8.0.14
--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 Unix socket file or Windows named pipe to use (ClassicSessions only)
--sql Start in SQL mode, auto-detecting protocol to use for connection
--sqlc Start in SQL mode using a ClassicSession
--sqlx Start in SQL mode using an X Protocol connection 8.0.3
--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 X.509 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 X.509 key
--ssl-mode Desired security state of connection to server
--tabbed Display output in tab separated format
--table Display output in table format
--tls-version Permissible TLS protocol for encrypted connections
--uri Session information in URI format
--user MySQL user name to use when connecting to server (alias for --dbuser)
--verbose Activate verbose output to the console 8.0.17
--version Display version information and exit
--vertical Display all SQL results vertically