MYSQLSH(1)
โจ MYSQLSH(1) โจ
okay so this is the MySQL Database System manual page for mysqlsh, bestie. buckle up. ๐
๐ธ NAME ๐ธ
mysqlsh โ the MySQL shell. periodt. ๐
๐ SYNOPSIS ๐
mysqlsh [options] db_name
๐ DESCRIPTION ๐
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. 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[1]. 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.
โจ the options, one by one โจ
--help,-?โ Display a help message and exit. so you can dip with the cheat sheet if you need it ๐--โ Marks the end of the list ofmysqlshoptions and the start of a command and its arguments for MySQL Shell's API command line integration. You can execute methods of the MySQL Shell global objects from the command line using this syntax:
mysqlsh [options] -- object method [arguments]
See Section 5.8, โAPI Command Line Integrationโ for more information.
--auth-method=methodโ Authentication method to use for the account. Depends on the authentication plugin used for the account's password. For MySQL Shell connections using classic MySQL protocol, specify the name of the authentication plugin, for examplecaching_sha2_password. For MySQL Shell connections using X Protocol, specify one of the following options:AUTOโ Let the library select the authentication method.FALLBACKโ Let the library select the authentication method, but do not use any authentication method that is not compatible with MySQL 5.7.FROM_CAPABILITIESโ Let the library select the authentication method, using the capabilities announced by the server instance.MYSQL41โ Use the challenge-response authentication protocol supported by MySQL 4.1 and later, which does not send a plaintext password. This option is compatible with accounts that use themysql_native_passwordauthentication plugin.PLAINโ Send a plaintext password for authentication. Use this option only with encrypted connections. This option can be used to authenticate with cached credentials for an account that uses thecaching_sha2_passwordauthentication plugin, provided there is an SSL connection. SeeUsing X Plugin with the Caching SHA-2 Authentication Plugin[2].SHA256_MEMORYโ Authenticate using a hashed password stored in memory. This option can be used to authenticate with cached credentials for an account that uses thecaching_sha2_passwordauthentication plugin, where there is a non-SSL connection. SeeUsing X Plugin with the Caching SHA-2 Authentication Plugin[2].
For MySQL Shell connections using classic MySQL protocol, specify the name of the authentication plugin used by the user account, for example caching_sha2_password (which is the default for user accounts created in MySQL 8.0). MySQL Shell uses the MySQL client library for client-side authentication for these connections. The following authentication methods require additional configuration:
clear_text_passwordโ Themysql_clear_passwordclient-side plugin is required for simple LDAP authentication. It is built in to the MySQL client library, but for security it is not enabled by default. From MySQL Shell 8.0.27, MySQL Shell enables and uses the plugin when you specify it with the--auth-method=clear_text_passwordconnection option. This authentication type is only suitable for a secure connection that uses SSL or sockets, so you must configure the secure connection before using it. Note that with the optionssl-mode=preferred, the SSL connection is not guaranteed, so a connection with this option set is not considered to be an SSL connection. For more information, seeSection 4.3.4, โUsing Encrypted Connectionsโ.authentication_ldap_sasl_clientโ Theauthentication_ldap_sasl_clientclient-side plugin is for SASL-based LDAP authentication, including GSSAPI/Kerberos authentication. It is not built in to the MySQL client library, but it is shipped in the MySQL Server packages. To load it, you must use the--mysql-plugin-diroption (available from MySQL Shell 8.0.27) to specify a path to the plugin in the MySQL Server packages.authentication_kerberos_clientโ Theauthentication_kerberos_clientclient-side plugin is for Kerberos authentication. It is not built in to the MySQL client library, but it is shipped in the MySQL Server packages. To load it, you must use the--mysql-plugin-diroption (available from MySQL Shell 8.0.27) to specify a path to the plugin in the MySQL Server packages.
Cached ticket-granting tickets (TGTs) for Kerberos authentication are supported from MySQL 8.0.27 when the --auth-method option is used to specify the authentication_ldap_sasl_client or authentication_kerberos_client plugin, and the --mysql-plugin-dir option is used to provide a path to the plugin. To use cached TGTs, do not specify a user and password in the connection options. When you specify one of these plugins and do not specify a user and password, MySQL Shell does not supply the system user name, does not prompt for a password, and does not attempt to use the Secret Store helper to retrieve or store credentials.
For more information, see Section 4.3.5, โUsing LDAP and Kerberos Authenticationโ.
--clusterโ Ensures that the target server is part of anInnoDB Clusterand if so, sets theclusterglobal variable to the cluster object.--column-type-infoโ In SQL mode, before printing the returned result set for a query, print metadata for each column in the result set, such as the column type and collation.
The column type is returned as both the type used by MySQL Shell (Type), and the type used by the original database (DBType). For MySQL Shell connections using classic MySQL protocol, DBType is as returned by the protocol, and for X Protocol connections, DBType is inferred from the available information. The column length (Length) is returned in bytes.
--compress[={required|preferred|disabled}],-C[{required|preferred|disabled}]โ Controls compression of information sent between the client and the server using this connection. In MySQL Shell 8.0.14 through 8.0.19 this option is available for classic MySQL protocol connections only, and does not use the optionsrequired,preferred, anddisabled. In those releases, when you specify--compress, compression is activated if possible. From MySQL Shell 8.0.20 it is also available for X Protocol connections, and you can optionally specifyrequired,preferred, ordisabled. When just--compressis specified from MySQL Shell 8.0.20, the meaning is--compress=required. SeeSection 4.3.7, โUsing Compressed Connectionsโfor information on using MySQL Shell's compression control in all releases.--compression-algorithms=valueโ The permitted compression algorithms for connections to the server.- Command-Line Format:
--compression-algorithms=value - Introduced:
8.0.18 - Type:
Set - Default Value:
uncompressed - Valid Values:
zlib,zstd,uncompressed
- Command-Line Format:
See Section 4.3.7.1, โCompression Control For MySQL Shell 8.0.20 And Laterโ.
--compression-level=levelโ Compression level for connections to server that use any compression algorithm over X Protocol or forzstdonly on classic connections.- Command-Line Format:
--zstd-compression-level=# - Introduced:
8.0.18 - Type:
Integer
- Command-Line Format:
See Section 4.3.7.1, โCompression Control For MySQL Shell 8.0.20 And Laterโ.
--zstd-compression-level=level
Okay so bestie, this one is about how hard zstd should squeeze your connection data ๐
- Command-Line Format:
--zstd-compression-level=# - Introduced: 8.0.18
- Type: Integer
The compression level to use for connections to the server that use the zstd compression algorithm. The permitted levels are from 1 to 22, with larger values indicating increasing levels of compression ๐ฅ The default zstd compression level is 3. The compression level setting has no effect on connections that do not use zstd compression (so don't stress about it if zstd isn't your vibe).
See Section 4.3.7.1, โCompression Control For MySQL Shell 8.0.20 And Laterโ.
--connect-timeout=msโ Configures how long MySQL Shell waits (in milliseconds) to establish a global session specified through command-line arguments โฑ๏ธ--credential-store-helper=helperโ The Secret Store Helper that is to be used to store and retrieve passwords ๐ See Section 4.4, โPluggable Password Storeโ.--database=name,-D nameโ The default schema to use. This is an alias for--schema๐--dba=enableXProtocolโ Enable X Plugin on connection with a MySQL 5.7 server, so that you can use X Protocol connections for subsequent connections. Requires a connection using classic MySQL protocol ๐ซถ Not relevant for MySQL 8.0 servers, which have X Plugin enabled by default (they're already iconic like that).--dba-log-sql[=0|1|2]โ Log SQL statements that are executed by AdminAPI operations (excluding sandbox operations). By default, this category of statement is not written to the MySQL Shell application log file or sent to the console as verbose output, even when the--log-leveland--verboseoptions are set. The value of the option is an integer in the range from 0 to 2 ๐ง0does not log or display this category of statement, which is the default behavior if you do not specify the option.1logs SQL statements that are executed by AdminAPI operations, with the exceptions ofSELECTstatements andSHOWstatements (this is the default setting if you specify the option on the command line without a value).2logs SQL statements that are executed by regular AdminAPI operations in full, includingSELECTandSHOWstatements.
See Chapter 12, MySQL Shell Logging and Debug for more information.
--log-sql[=off|error|on|all|unfiltered]โ Log all SQL statements executed by MySQL Shell to the MySQL Shell log file,mysqlsh.log๐
The following options are available:
offโ No MySQL Shell SQL statements are logged.errorโ (Default value) only MySQL Shell failed SQL statements with are logged. (yes that's exactly what it says, we don't make the rules)onโ All MySQL Shell SQL statements are logged, except those which match the ignore pattern defined inlogSql.ignorePatternandlogSql.ignorePatternUnsafe. See the section called โFiltering SQL Loggingโ for more information.allโ All MySQL Shell SQL statements are logged, except those which match the ignore pattern defined inlogSql.ignorePatternUnsafe. See the section called โFiltering SQL Loggingโ for more information.unfilteredโ All MySQL Shell SQL statements are logged, no filtering is performed ๐ญ
--dbpassword[=password]โ Deprecated in version 8.0.13 of MySQL Shell. Use--password[=password]instead. (bestie it's giving โจretiredโจ)--dbuser=user_nameโ Deprecated in version 8.0.13 of MySQL Shell. Use--user=user_nameinstead.--execute=command,-e commandโ Execute the command using the currently active language and quit. This option is mutually exclusive with the--file=file_nameoption ๐--fido-register-factorโ The factor or factors for which FIDO device registration must be performed. This option value must be a single value, or two values separated by commas. Each value must be2or3, so the permitted option values are'2','3','2,3'and'3,2'๐
For example:
mysqlsh --user=user_name --password1 --fido-register-factor=2
Enter password: (enter factor 1 password)
To register an account for passwordless authentication, with the FIDO device being the only authentication, you use --fido-register-factor=2 to provide the temporary password. The server moves FIDO authentication to the first factor after registration succeeds.
Note ๐ MySQL Shell prompts for a password if you do not specify one when connecting to the server. After you set up passwordless authentication with a FIDO device, use one of the following methods to bypass the password prompt when you make a connection: - Specify the connection option--no-password, or--password=with an empty value. - Place a colon (:) after the user name in the connection string, for example:mysqlsh user_name:@localhost- Press Enter when the password prompt appears.
MySQL Shellโs --fido-register-factor option works in the same way as the mysql client option. For more details and instructions, see FIDO Pluggable Authentication[3].
--file=file_name,-f file_nameโ Specify a file to process in Batch mode. Any options specified after this are used as arguments of the processed file ๐--forceโ Continue processing in SQL and Batch modes even if errors occur ๐--histignore=stringsโ Specify strings that are not added to the MySQL Shell history ๐ธ Strings are separated by a colon. Matching is case insensitive, and the wildcards*and?can be used. The default ignored strings are specified as โ*IDENTIFIED*:*PASSWORD*โ. See Section 5.5, โCode Historyโ.--host=host_name,-h host_nameโ Connect to the MySQL server on the given host ๐ On Windows, if you specify--host=.or-h .(giving the host name as a period), MySQL Shell connects using the default named pipe (which has the nameMySQL), or an alternative named pipe that you specify using the--socketoption.--get-server-public-keyโ MySQL Shell equivalent of--get-server-public-key๐ซ
If --server-public-key-path=file_name is given and specifies a valid public key file, it takes precedence over --get-server-public-key.
Important โ ๏ธ Only supported with classic MySQL protocol connections.
See Caching SHA-2 Pluggable Authentication[4].
--importโ Import JSON documents from a file or standard input to a MySQL Server collection or relational table, using the JSON import utility ๐ For instructions, see Section 11.2, โJSON Import Utilityโ.--interactive[=full],-iโ Emulate Interactive mode in Batch mode ๐--js,--javascriptโ Start in JavaScript mode โจ--json[={off|pretty|raw}]โ Controls JSON wrapping for MySQL Shell output from this session. This option is intended for interfacing MySQL Shell with other programs, for example as part of testing ๐งช For changing query results output to use the JSON format, see--result-format.
When the --json option has no value or a value of pretty, the output is generated as pretty-printed JSON. With a value of raw, the output is generated in raw JSON format. In any of these cases, the --result-format option and its aliases and the value of the resultFormat MySQL Shell configuration option are ignored. With a value of off, JSON wrapping does not take place, and result sets are output as normal in the format specified by the --result-format option or the resultFormat configuration option.
--log-file=pathโ Change the location of the MySQL Shell application log filemysqlsh.logfor this MySQL Shell instance ๐ The default location for the application log file is the user configuration path, which defaults to%APPDATA%\MySQL\mysqlsh\on Windows or~/.mysqlsh/on Unix. You can override the user configuration path for all MySQL Shell instances by defining the environment variableMYSQLSH_USER_CONFIG_HOME. The--log-fileoption applies to the individual MySQL Shell instance, meaning that different instances can write to different locations ๐ฏ--log-level=Nโ Change the logging level for the MySQL Shell application log filemysqlsh.log, or disable logging to the file. The option requires a value, which can be either an integer in the range from1to8, or one ofnone,internal,error,warning,info,debug,debug2, ordebug3๐ Specifying1ornonedisables logging to the application log file. Level 5 (info) is the default if you do not specify this option. See Chapter 12, MySQL Shell Logging and Debug.-maโ Deprecated in version 8.0.13 of MySQL Shell. Automatically attempts to use X Protocol to create the session's connection, and falls back to classic MySQL protocol if X Protocol is unavailable ๐--mysql,--mcโ Sets the global session created at start up to use a classic MySQL protocol connection ๐ The--mcoption with two hyphens replaces the previous single hyphen-mcoption from MySQL Shell 8.0.13.--mysql-plugin-dir=pathโ Sets a non-persistent path to the client-side authentication plugins by overriding the value of theshell.options.mysqlPluginDirsetting ๐ Client-side plugins are shipped in the MySQL Server packages and can be located relative to the MySQL base directory (the value of thebasedirsystem variable). For example:C:\program files\mysql\mysql Server 8.0\lib\pluginon Windows host types/usr/local/mysql/lib/pluginon Linux host types
For a list of the client authentication plugins that ship with the server, see Available Authentication Plugins[5].
--mysqlx,--mx
Sets the global session created at start up to use an X Protocol connection. The --mx option with two hyphens replaces the previous single hyphen -mx option from MySQL Shell 8.0.13.
--name-cacheโ turns on auto-loading of table names that's based on whatever your active default schema is. cozy autocomplete vibes ๐--no-name-cache,-Aโ kills the table-name loading for autocompletion (the kind based on your active default schema and the DevAPIdbobject). Wanna reload the name info by hand later? Just use\rehash. manual mode, bestie โจ--no-passwordโ okay so when you're connecting to the server, if the user has a passwordless account (which is insecure and genuinely not recommended, ngl) โ or if socket peer-credential authentication is in play (that's for Unix socket connections) โ you must use--no-passwordto explicitly say out loud that no password is being provided and the password prompt is not needed. no guessing games. say it with your chest ๐--no-wizard,-nwโ disables the interactive wizards from operations like creating connections,dba.configureInstance(),Cluster.rebootClusterFromCompleteOutage()and so on. Reach for this one when you wanna script MySQL Shell and not have those interactive prompts popping up. for more info see Section 5.6, โBatch Code Executionโ and Section 5.8, โAPI Command Line Integrationโ. no pop-ups, just vibes ๐ง--pager=nameโ the external pager tool that MySQL Shell uses to display text output for statements run in SQL mode, plus other selected commands like online help. If you don't set a pager, then the pager named by thePAGERenvironment variable gets used. see Section 4.6, โUsing a Pagerโ. scroll in style ๐--passwords-from-stdinโ reads the password from standard input instead of from the terminal. heads up tho: this option does not touch any other password behavior, like the password prompt. one job only ๐ซถ--password[=password],-ppasswordโ the password you use when connecting to the server. The maximum password length accepted for connecting to MySQL Shell is128characters. 128 chars, that's the limit fr--password=password(-ppassword) with a value supplies a password to use for the connection. With the long form--password=, you must use an equals sign and not a space between the option and its value. With the short form-p, there must be no space between the option and its value. If a space is used in either case, the value is not interpreted as a password and might get interpreted as another connection parameter. spaces = chaos, avoid ๐ญ
Specifying a password on the command line should be considered insecure. See End-User Guidelines for Password Security[6]. You can use an option file to avoid giving the password on the command line. pls don't type secrets in the open ๐
--passwordwith no value and no equal sign, or-pwithout a value, requests the password prompt. prompt era ๐--password=with an empty value has the same effect as--no-password, which specifies that the user is connecting without a password. When connecting to the server, if the user has a passwordless account โ which is insecure and not recommended โ or if socket peer-credential authentication is in use (for Unix socket connections), you must use one of these methods to explicitly specify that no password is provided and the password prompt is not required.
--password1[=password]โ so--password1,--password2and--password3are the passwords for accounts that require multifactor authentication. You can supply up to three passwords. These options work the same way as the--passwordoption, and--password1is treated as equivalent to that option. You can either drop a password value right after the option on the command line (which is insecure, ngl ๐ฌ) โ or, if the options are given without a password value, MySQL Shell prompts the user for each password in turn. These options are available from MySQL Shell 8.0.28, where they're only supported for classic MySQL protocol connections made using command-line arguments. triple password, triple slay ๐--password2[=password]โ the password for the second authentication method for accounts that require multifactor authentication. see the description for the--password1option. โจ--password3[=password]โ the password for the third authentication method for accounts that require multifactor authentication. see the description for the--password1option. โจ--port=port_num,-P port_numโ the TCP/IP port number to use for the connection. The default is port33060. port 33060, iconic ๐ฅ--py,--pythonโ start in Python mode. ๐ snake time--pyc=pythonCommand,-cโ execute a Python command and quit. Any options you specify after this get treated as arguments of the processed command.--pymโ execute the specified Python module as a script in MySQL Shell's Python mode.--pymworks the same way as Python's-mcommand line option. This option is available from MySQL Shell 8.0.22. python -m energy, periodt ๐--quiet-start[=1|2]โ start without printing the introductory info. Normally MySQL Shell prints product info, session info (like the default schema and connection ID), warning messages, and any errors returned during startup and connection. When you pass--quiet-startwith no value or a value of1, the info about the MySQL Shell product isn't printed, but session info, warnings, and errors still are. With a value of2, only errors get printed. less chatter, more focus โจ--recreate-schemaโ drop and recreate the schema specified in the connection options, whether it came as part of a URI-like connection string or via the--schema,--database, or-Doption. The schema is deleted if it exists. it's GONE gone โ careful bestie ๐--redirect-primaryโ makes sure the target server is part of an InnoDB Cluster or InnoDB ReplicaSet, and if it isn't the primary, finds the primary and connects to it. MySQL Shell exits with an error if any of these is true when using this option:- No instance is specified
- On an InnoDB Cluster, Group Replication is not active
- InnoDB Cluster metadata does not exist
- There is no quorum
--replicasetโ makes sure the target server belongs to an InnoDB ReplicaSet, and if so, populates thersglobal variable with the InnoDB ReplicaSet. Then you can administer the InnoDB ReplicaSet with thatrsglobal variable, like by runningrs.status(). main characterrsvariable ๐--redirect-secondaryโ makes sure the target server is part of a single-primary InnoDB Cluster or InnoDB ReplicaSet, and if it isn't a secondary, finds a secondary and connects to it. MySQL Shell exits with an error if any of these is true when using this option:- On an InnoDB Cluster, Group Replication is not active
- InnoDB Cluster metadata does not exist
- There is no quorum
- The cluster is not single-primary and is running in multi-primary mode
- There is no secondary available, for example because there is just one server instance
--result-format={table|tabbed|vertical|json|json/pretty|ndjson|json/raw|json/array}โ sets the value of theresultFormatMySQL Shell configuration option for this session. The formats are as follows:tableโ the default for interactive mode, unless another value has been set persistently for theresultFormatconfiguration option in the configuration file, in which case that default applies. The--tablealias can also be used. ๐tabbedโ the default for batch mode, unless another value has been set persistently for theresultFormatconfiguration option in the configuration file, in which case that default applies. The--tabbedalias can also be used. ๐verticalโ produces output equivalent to the\Gterminator for an SQL query. The--verticalor-Ealiases can also be used.jsonorjson/prettyโ produces pretty-printed JSON. โจndjsonorjson/rawโ produces raw JSON delimited by newlines.json/arrayโ produces raw JSON wrapped in a JSON array.
If the --json command line option is used to activate JSON wrapping for output for the session, then the --result-format option and its aliases and the value of the resultFormat configuration option are all ignored. yeah they get ghosted ๐ป
--save-passwords={always|prompt|never}โ controls whether passwords are automatically stored in the secret store.alwaysmeans passwords are always stored unless they're already in the store or the server URL is excluded by a filter.nevermeans passwords are never stored.prompt, which is the default, means users are asked whether to store the password or not. see Section 4.4, โPluggable Password Storeโ. secret store shenanigans ๐ซถ--schema=name,-D nameโ the default schema to use.--server-public-key-path=file_nameโ MySQL Shell equivalent of--server-public-key-path.
If --server-public-key-path=file_name is given and specifies a valid public key file, it takes precedence over --get-server-public-key. it wins, no cap ๐
Important Only supported with classic MySQL protocol connections.
See caching_sha2_password plugin Caching SHA-2 Pluggable Authentication[4]. ๐
--show-warnings={true|false}โ whentrueis specified, which is the default, in SQL mode MySQL Shell displays warnings after each SQL statement if there are any. Iffalseis specified, warnings are not displayed. your call bestie ๐--socket[=path],-S [path]โ on Unix, when a path is specified, that path is the name of the Unix socket file to use for the connection. If you specify--socketwith no value and no equal sign, or-Swithout a value, the default Unix socket file for the appropriate protocol is used.
On Windows, the path is the name of the named pipe to use for the connection. The pipe name is not case-sensitive. On Windows, you must specify a path, and the --socket option is available for classic MySQL protocol sessions only. windows rules hit different ๐
You can't specify a socket if you specify a port or a host name other than localhost on Unix, or a period (.) on Windows. pick a lane, bestie ๐ญ
--sql
okay so starting in SQL mode, MySQL Shell will literally auto-detect which protocol to use if you don't spell it out in the connection info ๐ธ. When the protocol isn't specified, it defaults to an X Protocol connection and then falls back to a classic MySQL protocol connection, bestie. Wanna force a specific one? That's what --sqlx or --sqlc are for. Or you can just name the protocol inside a URI-like connection string, or use the --port option. Full deets live in Section 4.3, โMySQL Shell Connectionsโ and MySQL Shell Ports[7]. ๐
--sqlcโ kicks things off in SQL mode and forces the connection to use the classic MySQL protocol. Use this when you need MySQL Shell to talk to a server that doesn't do X Protocol. If you don't stick a port in the connection info, MySQL Shell grabs the default classic MySQL protocol port, which is usually3306. The port you're connecting to has to support classic MySQL protocol โ so fr, if the connection you gave uses the X Protocol default port33060, the connection fails with an error, no cap ๐ญ. More info in Section 4.3, โMySQL Shell Connectionsโ and MySQL Shell Ports[7].--sqlxโ starts in SQL mode and forces the connection to use X Protocol. No port in your connection info? MySQL Shell uses the default X Protocol port, usually33060. And yeah, the port you're connecting to must support X Protocol โ so if your connection uses the classic MySQL protocol default port3306, it fails with an error ๐. See Section 4.3, โMySQL Shell Connectionsโ and MySQL Shell Ports[7].--ssh=strโ builds an SSH tunnel so your connection to the MySQL server instance is encrypted ๐. Hand over the URI for connecting to the SSH server in the format[user@]host[:port], like:
--ssh root@198.51.100.4:2222
When you use this one you also have to give the --user, --host, and --port options, or a URI, for the connection to the MySQL server instance. SSH tunnel tea is all in Section 4.3.6, โUsing an SSH Tunnelโ.
--ssh-config-file=pathโ points at the path to an SSH config file for the SSH server connection. You can use the MySQL Shell configuration optionssh.configFileto set a custom file as the default when this option isn't given. Ifssh.configFileisn't set, the default is the standard SSH config file~/.ssh/config๐. And if you pass--ssh-config-filewith an empty value, the default file fromssh.configFilegets ignored and~/.ssh/configis used instead.--ssh-identity-file=pathโ gives the path to an identity file for the SSH server connection. Don't specify it? Then the default is the standard private key file in the SSH config folder,~/.ssh/id_rsa๐.--ssl*โ every option starting with--sslsays whether to connect to the server using SSL and tells you where the SSL keys and certificates are hiding. ThemysqlshSSL options behave exactly like the SSL options for MySQL Server โ see Command Options for Encrypted Connections[8] for more.
mysqlsh accepts these SSL options: --ssl-mode, --ssl-ca, --ssl-capath, --ssl-cert, --ssl-cipher, --ssl-crl, --ssl-crlpath, --ssl-key, --tls-version, --tls-ciphersuites.
--syslogโ sends the SQL statements you run in MySQL Shell's SQL mode off to your operating system's system logging facility (syslog on Unix, or the Windows Event Log) ๐. Heads up tho: system logging for SQL statements only happens when MySQL Shell is started in interactive mode โ so a normal start, or a start with the--interactiveoption. It does not happen if you use--executeor--fileat startup to runmysqlshin batch mode. See Section 12.3, โSystem Logging for User SQL Statementsโ.--tabbedโ shows results in tab separated format in interactive mode (the default for that mode is table format). This one's an alias of--result-format=tabbedโจ.--tableโ shows results in table format in batch mode (the default for that mode is tab separated format). Alias of--result-format=table, bestie ๐ซถ.--uri=strโ creates a connection on startup, with the connection options handed over in a URI-like string, just like it says at Connecting to the Server Using URI-Like Strings or Key-Value Pairs[9].--user=user_name,-u user_nameโ the MySQL user name to use when connecting to the server. That's it, that's the whole vibe ๐.--verbose[=0|1|2|3|4]โ turns on verbose output to the console and sets how much detail you get. The value is an integer from0to4.0shows no messages at all, and that's the default verbosity when you don't specify the option.1shows error, warning and informational messages โ and that's the default when you put the option on the command line with no value.2,3, and4pile on higher levels of debug messages ๐ฅ. More in Chapter 12, MySQL Shell Logging and Debug.--version,-Vโ displays the version of MySQL Shell and dips ๐.--vertical,-Eโ displays results vertically, like when you use the\Gterminator for an SQL query. Alias of--result-format=vertical๐.
๐ COPYRIGHT ๐
Copyright ยฉ 2006, 2026, Oracle and/or its affiliates.
This documentation is free software โ you can redistribute it and/or modify it, but only under the terms of the GNU General Public License as published by the Free Software Foundation, version 2 of the License ๐.
This documentation is distributed hoping it'll be useful, but WITHOUT ANY WARRANTY โ not even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE ๐ญ. See the GNU General Public License for the full deets.
You should have received a copy of the GNU General Public License along with the program. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or peep http://www.gnu.org/licenses/.
๐ฆ NOTES ๐ฆ
- Using MySQL as a Document Store โ
https://dev.mysql.com/doc/refman/8.0/en/document-store.html - Using X Plugin with the Caching SHA-2 Authentication Plugin โ
https://dev.mysql.com/doc/refman/8.0/en/x-plugin-sha2-cache-plugin.html - FIDO Pluggable Authentication โ
https://dev.mysql.com/doc/refman/8.0/en/fido-pluggable-authentication.html - Caching SHA-2 Pluggable Authentication โ
https://dev.mysql.com/doc/refman/8.0/en/caching-sha2-pluggable-authentication.html - Available Authentication Plugins โ
https://dev.mysql.com/doc/refman/8.0/en/pluggable-authentication.html#pluggable-authentication-available-plugins - End-User Guidelines for Password Security โ
https://dev.mysql.com/doc/refman/8.0/en/password-security-user.html - MySQL Shell Ports โ
https://dev.mysql.com/doc/mysql-port-reference/en/mysql-port-reference-tables.html#GUID-65C1FF7E-5357-4E58-8D68-A0C3D24C0832__MYSQL-SHELL-PORTS - Command Options for Encrypted Connections โ
https://dev.mysql.com/doc/refman/8.0/en/connection-options.html#encrypted-connection-options - Connecting to the Server Using URI-Like Strings or Key-Value Pairs โ
https://dev.mysql.com/doc/refman/8.0/en/connecting-using-uri-or-key-value-pairs.html
๐ AUTHOR ๐
Oracle Corporation (http://dev.mysql.com/).
and that's a wrap on the whole page, bestie ๐
๐ธ you just read the MySQL 8.0 manual page for MYSQLSH(1), dated 06/09/2026 โ go forth and connect, you absolute icon ๐ซถ๐
๐ฆ where this page comes from
- nixpkgs unstable: mysql-shell 9.7.1
- ubuntu stonking: mysql-shell 9.7.1+dfsg-0ubuntu1 ยท GPL-2.0-only
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms