Navigation

MySQL Shell Options

The following table lists some mysql command-line options available for use with the C Authentication Plugin, mongosql_auth.

See also

A complete list of command line can be found in the MySQL client documentation.

Option Value Notes
--default-auth mongosql_auth

Uses the C Authentication plugin. If you are using a MySQL option file, specify the following configuration to use the mongosql_auth plugin:

[client]
default-auth=mongosql_auth

Note

To use an option file with an ODBC DSN, add the USE_MYCNF=1 connection parameter to the DSN.

--user <your-username>

Possible parameters to this option are source=<authenticated-db> and mechanism=<auth-mechanism>. If no authenticated database is specified, it defaults to admin. If no authentication mechanism is specified, it defaults to SCRAM-SHA-1.

Note

If you use both the source and mechanism parameters, separate them with a & and enclose the entire option in single quotes. For example:

'--user=myTestUser?source=test&mechanism=SCRAM-SHA-1'
-p None, shell will prompt Required.
--plugin-dir <your-plugin-dir>

Optional. Use when the mongosql_auth plugin is not in the default MySQL plugin directory. The default plugin directory depnds on your platform:

Platform Default Location
macOS, Linux <mysql-home>/lib/plugin/
32-bit Windows "C:\Program Files (x86)\MySQL\MySQL Server 5.7\lib\plugin"
64-bit Windows "C:\Program Files\MySQL\MySQL Server 5.7\lib\plugin"