MySQL Shell 8.4.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.4.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, InnoDB ClusterSet, and InnoDB ReplicaSet deployments; see Chapter 6, MySQL AdminAPI.

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

mysqlsh supports the following command-line options.

Table A.1 mysqlsh Options

Option Name Description
-- Start of API command line integration
--auth-method Authentication method to use
--authentication-oci-client-config-profile Profile in the OCI configuration file
--cluster Connect to an InnoDB cluster
--column-type-info Print metadata for columns in result sets
--compress Compress all information sent between client and server
--connect-timeout Connection timeout for global session
--credential-store-helper The Secret Store helper for passwords
--database The schema to use (alias for --schema)
--dba Enable X Protocol on connection with MySQL 5.7 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
--histignore Strings that are not added to the history
--host Host on which MySQL server instance is located
--interactive Emulate Interactive mode in batch mode
--js, --javascript Start in JavaScript mode
--json Print output in JSON format
--log-file Log file location for this instance
--log-level Specify logging level
--log-sql Log all MySQL Shell-generated SQL statements to the MySQL Shell log file.
--mysql, -mc Create a session using classic MySQL protocol
--mysql-plugin-dir Directory where the client-side plugins are installed
--mysqlx, -mx Create a session using X Protocol
--name-cache Enable automatic loading of table names based on the active default schema
--no-name-cache Disable autocompletion
--no-password No password is provided for this connection
--no-wizard, --nw Disable the interactive wizards
--oci-config-file Path to the OCI configuration file to use
--pager The external pager tool used to display output
--password Password to use when connecting to server
--password1 Password 1 for multifactor authentication (equivalent to --password)
--password2 Password 2 for multifactor authentication
--password3 Password 3 for multifactor authentication
--passwords-from-stdin Read the password from stdin
--plugin-authentication-webauthn-client-preserve-privacy Enable user to choose a key to be used for assertion
--port TCP/IP port number for connection
--py, --python Start in Python mode
--pyc Execute a Python command and quit. Any options specified after this are treated as arguments of the processed command.
--quiet-start Start without printing introductory information
--redirect-primary Ensure connection to an InnoDB cluster's primary
--redirect-secondary Ensure connection to an InnoDB cluster's secondary
--register-factor Multifactor authentication factors for which registration must be done
--result-format Set the output format for this session
--save-passwords How passwords are stored in the Secret Store
--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 (classic MySQL protocol only)
--sql Start in SQL mode, auto-detecting protocol to use for connection
--sqlc Start in SQL mode using a classic MySQL protocol connection
--sqlx Start in SQL mode using an X Protocol connection
--ssh URI for connection to SSH server
--ssh-config-file Configuration file for connection to SSH server
--ssh-identity-file Identity file for connection to SSH server
--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
--syslog Log interactive SQL statements to the system logging facility
--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
--verbose Activate verbose output to the console
--version Display version information and exit
--vertical Display all SQL results vertically