Documentation Home
MySQL 9.0 Reference Manual
Related Documentation Download this Manual
PDF (US Ltr) - 40.0Mb
PDF (A4) - 40.1Mb
Man Pages (TGZ) - 259.0Kb
Man Pages (Zip) - 366.2Kb
Info (Gzip) - 4.0Mb
Info (Zip) - 4.0Mb


MySQL 9.0 Reference Manual  / ...  / MySQL Programs  / Administrative and Utility Programs  /  mysql_migrate_keyring — Keyring Key Migration Utility

6.6.8 mysql_migrate_keyring — Keyring Key Migration Utility

Themysql_migrate_keyring utility migrates keys between one keyring component and another. It supports offline and online migrations.

Invokemysql_migrate_keyring like this (enter the command on a single line):

mysql_migrate_keyring  --component-dir=dir_name  --source-keyring=name  --destination-keyring=name  [other options]

For information about key migrations and instructions describing how to perform them usingmysql_migrate_keyring and other methods, seeSection 8.4.4.11, “Migrating Keys Between Keyring Keystores”.

mysql_migrate_keyring supports the following options, which can be specified on the command line or in the[mysql_migrate_keyring] group of an option file. For information about option files used by MySQL programs, seeSection 6.2.2.2, “Using Option Files”.

Table 6.19 mysql_migrate_keyring Options

Option NameDescription
--component-dirDirectory for keyring components
--defaults-extra-fileRead named option file in addition to usual option files
--defaults-fileRead only named option file
--defaults-group-suffixOption group suffix value
--destination-keyringDestination keyring component name
--destination-keyring-configuration-dirDestination keyring component configuration directory
--get-server-public-keyRequest RSA public key from server
--helpDisplay help message and exit
--hostHost on which MySQL server is located
--login-pathRead login path options from .mylogin.cnf
--no-defaultsRead no option files
--no-login-pathsDo not read login paths from the login path file
--online-migrationMigration source is an active server
--passwordPassword to use when connecting to server
--portTCP/IP port number for connection
--print-defaultsPrint default options
--server-public-key-pathPath name to file containing RSA public key
--socketUnix socket file or Windows named pipe to use
--source-keyringSource keyring component name
--source-keyring-configuration-dirSource keyring component configuration directory
--ssl-caFile that contains list of trusted SSL Certificate Authorities
--ssl-capathDirectory that contains trusted SSL Certificate Authority certificate files
--ssl-certFile that contains X.509 certificate
--ssl-cipherPermissible ciphers for connection encryption
--ssl-crlFile that contains certificate revocation lists
--ssl-crlpathDirectory that contains certificate revocation-list files
--ssl-fips-modeWhether to enable FIPS mode on client side
--ssl-keyFile that contains X.509 key
--ssl-modeDesired security state of connection to server
--ssl-session-dataFile that contains SSL session data
--ssl-session-data-continue-on-failed-reuseWhether to establish connections if session reuse fails
--tls-ciphersuitesPermissible TLSv1.3 ciphersuites for encrypted connections
--tls-sni-servernameServer name supplied by the client
--tls-versionPermissible TLS protocols for encrypted connections
--userMySQL user name to use when connecting to server
--verboseVerbose mode
--versionDisplay version information and exit

  • --help,-h

    Command-Line Format--help

    Display a help message and exit.

  • --component-dir=dir_name

    Command-Line Format--component-dir=dir_name
    TypeDirectory name

    The directory where keyring components are located. This is typically the value of theplugin_dir system variable for the local MySQL server.

    Note

    --component-dir,--source-keyring, and--destination-keyring are mandatory for all keyring migration operations performed bymysql_migrate_keyring. In addition, the source and destination components must differ, and both components must be properly configured so thatmysql_migrate_keyring can load and use them.

  • --defaults-extra-file=file_name

    Command-Line Format--defaults-extra-file=file_name
    TypeFile name

    Read this option file after the global option file but (on Unix) before the user option file. If the file does not exist or is otherwise inaccessible, an error occurs. Iffile_name is not an absolute path name, it is interpreted relative to the current directory.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --defaults-file=file_name

    Command-Line Format--defaults-file=file_name
    TypeFile name

    Use only the given option file. If the file does not exist or is otherwise inaccessible, an error occurs. Iffile_name is not an absolute path name, it is interpreted relative to the current directory.

    Exception: Even with--defaults-file, client programs read.mylogin.cnf.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --defaults-group-suffix=str

    Command-Line Format--defaults-group-suffix=str
    TypeString

    Read not only the usual option groups, but also groups with the usual names and a suffix ofstr. For example,mysql_migrate_keyring normally reads the[mysql_migrate_keyring] group. If this option is given as--defaults-group-suffix=_other,mysql_migrate_keyring also reads the[mysql_migrate_keyring_other] group.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --destination-keyring=name

    Command-Line Format--destination-keyring=name
    TypeString

    The destination keyring component for key migration. The format and interpretation of the option value is the same as described for the--source-keyring option.

    Note

    --component-dir,--source-keyring, and--destination-keyring are mandatory for all keyring migration operations performed bymysql_migrate_keyring. In addition, the source and destination components must differ, and both components must be properly configured so thatmysql_migrate_keyring can load and use them.

  • --destination-keyring-configuration-dir=dir_name

    Command-Line Format--destination-keyring-configuration-dir=dir_name
    TypeDirectory name

    This option applies only if the destination keyring component global configuration file contains"read_local_config": true, indicating that component configuration is contained in the local configuration file. The option value specifies the directory containing that local file.

  • --get-server-public-key

    Command-Line Format--get-server-public-key
    TypeBoolean

    Request from the server the public key required for RSA key pair-based password exchange. This option applies to clients that authenticate with thecaching_sha2_password authentication plugin. For that plugin, the server does not send the public key unless requested. This option is ignored for accounts that do not authenticate with that plugin. It is also ignored if RSA-based password exchange is not used, as is the case when the client connects to the server using a secure connection.

    If--server-public-key-path=file_name is given and specifies a valid public key file, it takes precedence over--get-server-public-key.

    For information about thecaching_sha2_password plugin, seeSection 8.4.1.1, “Caching SHA-2 Pluggable Authentication”.

  • --host=host_name,-hhost_name

    Command-Line Format--host=host_name
    TypeString
    Default Valuelocalhost

    The host location of the running server that is currently using one of the key migration keystores. Migration always occurs on the local host, so the option always specifies a value for connecting to a local server, such aslocalhost,127.0.0.1,::1, or the local host IP address or host name.

  • --login-path=name

    Command-Line Format--login-path=name
    TypeString

    Read options from the named login path in the.mylogin.cnf login path file. Alogin path is an option group containing options that specify which MySQL server to connect to and which account to authenticate as. To create or modify a login path file, use themysql_config_editor utility. SeeSection 6.6.7, “mysql_config_editor — MySQL Configuration Utility”.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --no-login-paths

    Command-Line Format--no-login-paths

    Skips reading options from the login path file.

    See--login-path for related information.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --no-defaults

    Command-Line Format--no-defaults

    Do not read any option files. If program startup fails due to reading unknown options from an option file,--no-defaults can be used to prevent them from being read.

    The exception is that the.mylogin.cnf file is read in all cases, if it exists. This permits passwords to be specified in a safer way than on the command line even when--no-defaults is used. To create.mylogin.cnf, use themysql_config_editor utility. SeeSection 6.6.7, “mysql_config_editor — MySQL Configuration Utility”.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --online-migration

    Command-Line Format--online-migration
    TypeBoolean
    Default ValueFALSE

    This option is mandatory when a running server is using the keyring. It tellsmysql_migrate_keyring to perform an online key migration. The option has these effects:

    • mysql_migrate_keyring connects to the server using any connection options specified; these options are otherwise ignored.

    • Aftermysql_migrate_keyring connects to the server, it tells the server to pause keyring operations. When key copying is complete,mysql_migrate_keyring tells the server it can resume keyring operations before disconnecting.

  • --password[=password],-p[password]

    Command-Line Format--password[=password]
    TypeString

    The password of the MySQL account used for connecting to the running server that is currently using one of the key migration keystores. The password value is optional. If not given,mysql_migrate_keyring prompts for one. If given, there must beno space between--password= or-p and the password following it. If no password option is specified, the default is to send no password.

    Specifying a password on the command line should be considered insecure. To avoid giving the password on the command line, use an option file. SeeSection 8.1.2.1, “End-User Guidelines for Password Security”.

    To explicitly specify that there is no password and thatmysql_migrate_keyring should not prompt for one, use the--skip-password option.

  • --port=port_num,-Pport_num

    Command-Line Format--port=port_num
    TypeNumeric
    Default Value0

    For TCP/IP connections, the port number for connecting to the running server that is currently using one of the key migration keystores.

  • --print-defaults

    Command-Line Format--print-defaults

    Print the program name and all options that it gets from option files.

    For additional information about this and other option-file options, seeSection 6.2.2.3, “Command-Line Options that Affect Option-File Handling”.

  • --server-public-key-path=file_name

    Command-Line Format--server-public-key-path=file_name
    TypeFile name

    The path name to a file in PEM format containing a client-side copy of the public key required by the server for RSA key pair-based password exchange. This option applies to clients that authenticate with thesha256_password orcaching_sha2_password authentication plugin. This option is ignored for accounts that do not authenticate with one of those plugins. It is also ignored if RSA-based password exchange is not used, as is the case when the client connects to the server using a secure connection.

    If--server-public-key-path=file_name is given and specifies a valid public key file, it takes precedence over--get-server-public-key.

    Forsha256_password, this option applies only if MySQL was built using OpenSSL.

    For information about thesha256_password andcaching_sha2_password plugins, seeSection 8.4.1.2, “SHA-256 Pluggable Authentication”, andSection 8.4.1.1, “Caching SHA-2 Pluggable Authentication”.

  • --socket=path,-Spath

    Command-Line Format--socket={file_name|pipe_name}
    TypeString

    For Unix socket file or Windows named pipe connections, the socket file or named pipe for connecting to the running server that is currently using one of the key migration keystores.

    On Windows, this option applies only if the server was started with thenamed_pipe system variable enabled to support named-pipe connections. In addition, the user making the connection must be a member of the Windows group specified by thenamed_pipe_full_access_group system variable.

  • --source-keyring=name

    Command-Line Format--source-keyring=name
    TypeString

    The source keyring component for key migration. This is the component library file name specified without any platform-specific extension such as.so or.dll. For example, to use the component for which the library file iscomponent_keyring_file.so, specify the option as--source-keyring=component_keyring_file.

    Note

    --component-dir,--source-keyring, and--destination-keyring are mandatory for all keyring migration operations performed bymysql_migrate_keyring. In addition, the source and destination components must differ, and both components must be properly configured so thatmysql_migrate_keyring can load and use them.

  • --source-keyring-configuration-dir=dir_name

    Command-Line Format--source-keyring-configuration-dir=dir_name
    TypeDirectory name

    This option applies only if the source keyring component global configuration file contains"read_local_config": true, indicating that component configuration is contained in the local configuration file. The option value specifies the directory containing that local file.

  • --ssl*

    Options that begin with--ssl specify whether to connect to the server using encryption and indicate where to find SSL keys and certificates. SeeCommand Options for Encrypted Connections.

  • --ssl-fips-mode={OFF|ON|STRICT}

    Command-Line Format--ssl-fips-mode={OFF|ON|STRICT}
    DeprecatedYes
    TypeEnumeration
    Default ValueOFF
    Valid Values

    OFF

    ON

    STRICT

    Controls whether to enable FIPS mode on the client side. The--ssl-fips-mode option differs from other--ssl-xxx options in that it is not used to establish encrypted connections, but rather to affect which cryptographic operations to permit. SeeSection 8.8, “FIPS Support”.

    These--ssl-fips-mode values are permitted:

    • OFF: Disable FIPS mode.

    • ON: Enable FIPS mode.

    • STRICT: Enablestrict FIPS mode.

    Note

    If the OpenSSL FIPS Object Module is not available, the only permitted value for--ssl-fips-mode isOFF. In this case, setting--ssl-fips-mode toON orSTRICT causes the client to produce a warning at startup and to operate in non-FIPS mode.

    This option is deprecated. Expect it to be removed in a future version of MySQL.

  • --tls-ciphersuites=ciphersuite_list

    Command-Line Format--tls-ciphersuites=ciphersuite_list
    TypeString

    The permissible ciphersuites for encrypted connections that use TLSv1.3. The value is a list of one or more colon-separated ciphersuite names. The ciphersuites that can be named for this option depend on the SSL library used to compile MySQL. For details, seeSection 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”.

  • --tls-sni-servername=server_name

    Command-Line Format--tls-sni-servername=server_name
    TypeString

    When specified, the name is passed to thelibmysqlclient C API library using theMYSQL_OPT_TLS_SNI_SERVERNAME option ofmysql_options(). The server name is not case-sensitive. To show which server name the client specified for the current session, if any, check theTls_sni_server_name status variable.

    Server Name Indication (SNI) is an extension to the TLS protocol (OpenSSL must be compiled using TLS extensions for this option to function). The MySQL implementation of SNI represents the client-side only.

  • --tls-version=protocol_list

    Command-Line Format--tls-version=protocol_list
    TypeString
    Default Value

    TLSv1,TLSv1.1,TLSv1.2,TLSv1.3 (OpenSSL 1.1.1 or higher)

    TLSv1,TLSv1.1,TLSv1.2 (otherwise)

    The permissible TLS protocols for encrypted connections. The value is a list of one or more comma-separated protocol names. The protocols that can be named for this option depend on the SSL library used to compile MySQL. For details, seeSection 8.3.2, “Encrypted Connection TLS Protocols and Ciphers”.

  • --user=user_name,-uuser_name

    Command-Line Format--user=user_name
    TypeString

    The user name of the MySQL account used for connecting to the running server that is currently using one of the key migration keystores.

  • --verbose,-v

    Command-Line Format--verbose

    Verbose mode. Produce more output about what the program does.

  • --version,-V

    Command-Line Format--version

    Display version information and exit.