MYSQL_MIGRATE_KEYRING(1)

๐Ÿ“ฆ version 8.4.0, in nixos 26.05, nixpkgs unstable

๐ŸŒธ NAME ๐ŸŒธ

mysql_migrate_keyring โ€” keyring key migration utility. This is the MYSQL_MIGRATE_KEYRING(1) manual page from the MySQL Database System, bestie, and we're gonna make key migration make sense. ๐Ÿ’–

โœจ SYNOPSIS โœจ

mysql_migrate_keyring [options]

๐Ÿ’… DESCRIPTION ๐Ÿ’…

Okay so mysql_migrate_keyring is the utility that migrates keys between one keyring component and another. It supports offline and online migrations. Slay. โœจ

Invoke it like this โ€” and yes, enter the command on a single line, bestie:

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 using mysql_migrate_keyring and other methods, see Section 8.4.4.14, โ€œ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, see Section 6.2.2.2, โ€œUsing Option Filesโ€.

๐ŸŽ€ OPTIONS ๐ŸŽ€

  • --help, -h โ€” displays a help message and exits. That's it, that's the whole vibe. ๐Ÿ’…
    • Command-line format: --help
  • --component-dir=dir_name โ€” the directory where keyring components are located, bestie. This is typically the value of the plugin_dir system variable for the local MySQL server. ๐Ÿ“
    • Command-line format: --component-dir=dir_name
    • Type: Directory name
โš ๏ธ Note: --component-dir, --source-keyring, and --destination-keyring are mandatory for all keyring migration operations performed by mysql_migrate_keyring. In addition, the source and destination components must differ, and both components must be properly configured so that mysql_migrate_keyring can load and use them.
  • --defaults-extra-file=file_name โ€” reads 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. If file_name is not an absolute path name, it is interpreted relative to the current directory. ๐Ÿ—‚๏ธ
    • Command-line format: --defaults-extra-file=file_name
    • Type: File name For additional information about this and other option-file options, see Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.
  • --defaults-file=file_name โ€” use only the given option file. If the file does not exist or is otherwise inaccessible, an error occurs. If file_name is not an absolute path name, it is interpreted relative to the current directory. ๐Ÿ“„
    • Command-line format: --defaults-file=file_name
    • Type: File name
Exception, bestie: even with --defaults-file, client programs read .mylogin.cnf.

For additional information about this and other option-file options, see Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.

  • --defaults-group-suffix=str โ€” reads not only the usual option groups, but also groups with the usual names and a suffix of str. 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. ๐ŸŽ€
    • Command-line format: --defaults-group-suffix=str
    • Type: String For additional information about this and other option-file options, see Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.
  • --destination-keyring=name โ€” 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. ๐ŸŽฏ
    • Command-line format: --destination-keyring=name
    • Type: String
โš ๏ธ Note: --component-dir, --source-keyring, and --destination-keyring are mandatory for all keyring migration operations performed by mysql_migrate_keyring. In addition, the source and destination components must differ, and both components must be properly configured so that mysql_migrate_keyring can load and use them.
  • --destination-keyring-configuration-dir=dir_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. ๐Ÿ“‚
    • Command-line format: --destination-keyring-configuration-dir=dir_name
    • Type: Directory name
  • --get-server-public-key โ€” requests from the server the public key required for RSA key pair-based password exchange. This option applies to clients that authenticate with the caching_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. ๐Ÿ”
    • Command-line format: --get-server-public-key
    • Type: Boolean 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 the caching_sha2_password plugin, see Section 8.4.1.2, โ€œCaching SHA-2 Pluggable Authenticationโ€.
  • --host=host_name, -h host_name โ€” 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 as localhost, 127.0.0.1, ::1, or the local host IP address or host name. ๐Ÿ–ฅ๏ธ
    • Command-line format: --host=host_name
    • Type: String
    • Default value: localhost
  • --login-path=name โ€” the login path option, with the command-line format and type below. ๐ŸŒˆ
    • Command-line format: --login-path=name
    • Type: String

Still on --login-path for like two more seconds, bestie: it reads options from the login path you named inside the .mylogin.cnf login path file. And a "login path" is just an option group holding the options that say which MySQL server to connect to and which account to authenticate as. To create or modify a login path file, use the mysql_config_editor utility โ€” see mysql_config_editor(1).

And for extra info about this and other option-file options, peek at Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.

Okay, moving on, the actual list continues ๐Ÿ’…

  • --no-login-paths โ€” skips reading options from the login path file, periodt. See --login-path for the related tea โœจ
    • Command-Line Format: --no-login-paths
    • For additional information about this and other option-file options, see Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.
  • --no-defaults โ€” do NOT read any option files, literally none. If program startup is failing because it's reading unknown options out of an option file, --no-defaults is your bestie for stopping them from being read at all.
    • Command-Line Format: --no-defaults
    • The exception (because of course there's an exception ๐Ÿซ ): 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 the mysql_config_editor utility. See mysql_config_editor(1).
    • For additional information about this and other option-file options, see Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.
  • --online-migration โ€” this one is mandatory when a running server is using the keyring. It tells mysql_migrate_keyring to perform an online key migration. The option has these effects:
    • Command-Line Format: --online-migration
    • Type: Boolean
    • Default Value: FALSE
    • mysql_migrate_keyring connects to the server using any connection options specified; these options are otherwise ignored.
    • After mysql_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. Iconic behavior honestly ๐Ÿ‘‘
  • --password[=password], -p[password] โ€” the password of the MySQL account used for connecting to the running server that is currently using one of the key migration keystores.
    • Command-Line Format: --password[=password]
    • Type: String
    • The password value is optional. If not given, mysql_migrate_keyring prompts for one. If given, there must be no 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, no cap ๐Ÿ˜ฌ. To avoid giving the password on the command line, use an option file. See Section 8.1.2.1, โ€œEnd-User Guidelines for Password Securityโ€.
    • To explicitly specify that there is no password and that mysql_migrate_keyring should not prompt for one, use the --skip-password option.
  • --port=port_num, -P port_num โ€” for TCP/IP connections, the port number for connecting to the running server that is currently using one of the key migration keystores.
    • Command-Line Format: --port=port_num
    • Type: Numeric
    • Default Value: 0
  • --print-defaults โ€” print the program name and all options that it gets from option files. That's the whole vibe ๐ŸŽ€
    • Command-Line Format: --print-defaults
    • For additional information about this and other option-file options, see Section 6.2.2.3, โ€œCommand-Line Options that Affect Option-File Handlingโ€.
  • --server-public-key-path=file_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.
    • Command-Line Format: --server-public-key-path=file_name
    • Type: File name
    • This option applies to clients that authenticate with the sha256_password or caching_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.
    • For sha256_password, this option applies only if MySQL was built using OpenSSL.
    • For information about the sha256_password and caching_sha2_password plugins, see Section 8.4.1.3, โ€œSHA-256 Pluggable Authenticationโ€, and Section 8.4.1.2, โ€œCaching SHA-2 Pluggable Authenticationโ€.
  • --socket=path, -S path โ€” 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.
    • Command-Line Format: --socket={file_name|pipe_name}
    • Type: String
    • On Windows, this option applies only if the server was started with the named_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 the named_pipe_full_access_group system variable. Windows girlies stay having extra rules, we love that for them ๐ŸชŸ
  • --source-keyring=name โ€” 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 is component_keyring_file.so, specify the option as --source-keyring=component_keyring_file.
    • Command-Line Format: --source-keyring=name
    • Type: String
    • > Note: --component-dir, --source-keyring, and --destination-keyring are mandatory for all keyring migration operations performed by mysql_migrate_keyring. In addition, the source and destination components must differ, and both components must be properly configured so that mysql_migrate_keyring can load and use them. Like, no shortcuts, bestie ๐Ÿ’€

  • --source-keyring-configuration-dir=dir_name
    • Command-Line Format: --source-keyring-configuration-dir=dir_name
    • Type: Directory name

Okay so this one only does anything if the source keyring component's global config file has "read_local_config": true in it โ€” that's the flag saying "hey, my real settings live in the local config file." When that's the case, this option tells the program which directory that local file is chillin' in. That's it, that's the whole vibe. ๐Ÿ’…

  • --ssl* โ€” any option starting with --ssl is about whether you connect to the server with encryption, plus where to find your SSL keys and certificates. For the full rundown, peep the section called "Command Options for Encrypted Connections." ๐Ÿ”
  • --ssl-fips-mode={OFF|ON|STRICT}
    • Command-Line Format: --ssl-fips-mode={OFF|ON|STRICT}
    • Deprecated: Yes
    • Type: Enumeration
    • Default Value: OFF
    • Valid Values: OFF, ON, STRICT

This bad boy controls whether FIPS mode is turned on for the client side. And here's the tea: --ssl-fips-mode is not like the other --ssl-xxx options, because it doesn't establish encrypted connections โ€” it changes which cryptographic operations are allowed. See Section 8.8, "FIPS Support." ๐Ÿงš

These values are permitted:

  • OFF: disable FIPS mode.
  • ON: enable FIPS mode.
  • STRICT: enable "strict" FIPS mode.
Note: if the OpenSSL FIPS Object Module isn't available, the only permitted value for --ssl-fips-mode is OFF. In that case, setting it to ON or STRICT makes the client throw a warning at startup and just operate in non-FIPS mode anyway. ๐Ÿ™ˆ

Heads up, bestie: this option is deprecated. Expect it to be gone in a future version of MySQL. ๐Ÿ˜ญ

  • --tls-ciphersuites=ciphersuite_list
    • Command-Line Format: --tls-ciphersuites=ciphersuite_list
    • Type: String

These are the permissible ciphersuites for encrypted connections using TLSv1.3. The value is a list of one or more colon-separated ciphersuite names. Which ciphersuites you can actually name here depends on the SSL library MySQL was compiled with. For the details, see Section 8.3.2, "Encrypted Connection TLS Protocols and Ciphers." โœจ

  • --tls-sni-servername=server_name
    • Command-Line Format: --tls-sni-servername=server_name
    • Type: String

When you specify this, the name gets passed to the libmysqlclient C API library using the MYSQL_OPT_TLS_SNI_SERVERNAME option of mysql_options(). The server name is not case-sensitive. Wanna see which server name the client specified for the current session, if any? Check the Tls_sni_server_name status variable. ๐Ÿ”

Server Name Indication (SNI) is an extension to the TLS protocol โ€” and btw, OpenSSL must be compiled using TLS extensions for this option to actually function. The MySQL implementation of SNI represents the client side only, iykyk. ๐Ÿฆ‹

  • --tls-version=protocol_list
    • Command-Line Format: --tls-version=protocol_list
    • Type: String
    • 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. Which protocols you can name depends on the SSL library MySQL was compiled with. For the details, see Section 8.3.2, "Encrypted Connection TLS Protocols and Ciphers." ๐ŸŒˆ

  • --user=user_name, -u user_name
    • Command-Line Format: --user=user_name
    • Type: String

The user name of the MySQL account used to connect to the running server that's currently using one of the key migration keystores. That's your login, bestie. ๐Ÿ”‘

  • --verbose, -v
    • Command-Line Format: --verbose

Verbose mode, aka the "tell me everything" era. Produces more output about what the program's actually doing. Obsessed, honestly. ๐Ÿ‘‘

  • --version, -V
    • Command-Line Format: --version

Display version information and then dip out. Short and sweet. ๐Ÿ’–


Copyright ยฉ 1997, 2024, Oracle and/or its affiliates.

This documentation is free software; you can redistribute it and/or modify it 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 in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ๐Ÿซถ

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 see http://www.gnu.org/licenses/. ๐Ÿ’œ


๐Ÿ‘€ SEE ALSO ๐Ÿ‘€

For more information, please refer to the MySQL Reference Manual โ€” which may already be installed locally, and which is also available online at http://dev.mysql.com/doc/. Go read it, it's giving encyclopedia but make it slay. ๐ŸŒธ


๐ŸŽ€ AUTHOR ๐ŸŽ€

Oracle Corporation (http://dev.mysql.com/). ๐Ÿขโœจ


Bestie, that's the whole page!! You made it to the end of the group chat ๐ŸŽ‰ โ€” this iconic piece of documentation is from MySQL 8.4, dated 03/11/2024. Now go migrate those keyrings, no cap. ๐Ÿ’…๐Ÿฆ‹โญ

๐Ÿ“ฆ where this page comes from