MYSQL_SSL_RSA_SETUP(1)
π NAME π
mysql_ssl_rsa_setup β bestie, this one makes SSL/RSA files for you β¨
It's part of the MySQL Database System manual, and yes we're getting into it π
πΈ SYNOPSIS πΈ
mysql_ssl_rsa_setup [options]
π¦ DESCRIPTION π¦
β οΈ Heads up, queen: mysql_ssl_rsa_setup is deprecated as of MySQL 8.0.34. Instead, consider using MySQL server to generate missing SSL and RSA files automatically at startup (see the section called "Automatic SSL and RSA File Generation").
So like, what does this program do? It creates the SSL certificate and key files and RSA key-pair files that you need to support secure connections using SSL and secure password exchange using RSA over unencrypted connections β if those files are missing. And plot twist, mysql_ssl_rsa_setup can also be used to create new SSL files if the existing ones have expired. Iconic behaviour, honestly π«Ά
π Note:mysql_ssl_rsa_setupuses theopensslcommand, so its use is contingent on having OpenSSL installed on your machine. No OpenSSL, no vibes.
π Also a note: Another way to generate SSL and RSA files, for MySQL distributions compiled using OpenSSL, is to have the server generate them automatically. See Section 8.3.3.1, "Creating SSL and RSA Certificates and Keys using MySQL".
π¨ IMPORTANT, bestie, listen:mysql_ssl_rsa_setuphelps lower the barrier to using SSL by making it easier to generate the required files. However, certificates generated bymysql_ssl_rsa_setupare self-signed, which is not very secure. After you gain experience using the files created bymysql_ssl_rsa_setup, consider obtaining a CA certificate from a registered certificate authority. Like, glow up your security when you're ready π
Invoke mysql_ssl_rsa_setup like this:
mysql_ssl_rsa_setup [options]
Typical options are --datadir to specify where to create the files, and --verbose to see the openssl commands that mysql_ssl_rsa_setup executes. Very main character of you to want to watch it work π
mysql_ssl_rsa_setup attempts to create SSL and RSA files using a default set of file names. It works as follows:
mysql_ssl_rsa_setupchecks for theopensslbinary at the locations specified by thePATHenvironment variable. Ifopensslis not found,mysql_ssl_rsa_setupdoes nothing. Ifopensslis present,mysql_ssl_rsa_setuplooks for default SSL and RSA files in the MySQL data directory specified by the--datadiroption, or the compiled-in data directory if the--datadiroption is not given.mysql_ssl_rsa_setupchecks the data directory for SSL files with the following names:
ca.pem
server-cert.pem
server-key.pem
- If any of those files are present,
mysql_ssl_rsa_setupcreates no SSL files. Otherwise, it invokesopensslto create them, plus some additional files:
ca.pem Self-signed CA certificate
ca-key.pem CA private key
server-cert.pem Server certificate
server-key.pem Server private key
client-cert.pem Client certificate
client-key.pem Client private key
These files enable secure client connections using SSL; see Section 8.3.1, "Configuring MySQL to Use Encrypted Connections".
mysql_ssl_rsa_setupchecks the data directory for RSA files with the following names:
private_key.pem Private member of private/public key pair
public_key.pem Public member of private/public key pair
- If any of these files are present,
mysql_ssl_rsa_setupcreates no RSA files. Otherwise, it invokesopensslto create them. These files enable secure password exchange using RSA over unencrypted connections for accounts authenticated by thesha256_passwordorcaching_sha2_passwordplugin; see Section 8.4.1.3, "SHA-256 Pluggable Authentication", and Section 8.4.1.2, "Caching SHA-2 Pluggable Authentication".
For information about the characteristics of files created by mysql_ssl_rsa_setup, see Section 8.3.3.1, "Creating SSL and RSA Certificates and Keys using MySQL". β¨
At startup, the MySQL server automatically uses the SSL files created by mysql_ssl_rsa_setup to enable SSL if no explicit SSL options are given other than --ssl (possibly along with ssl_cipher). If you prefer to designate the files explicitly, invoke clients with the --ssl-ca, --ssl-cert, and --ssl-key options at startup to name the ca.pem, server-cert.pem, and server-key.pem files, respectively.
The server also automatically uses the RSA files created by mysql_ssl_rsa_setup to enable RSA if no explicit RSA options are given.
If the server is SSL-enabled, clients use SSL by default for the connection. To specify certificate and key files explicitly, use the --ssl-ca, --ssl-cert, and --ssl-key options to name the ca.pem, client-cert.pem, and client-key.pem files, respectively. However, some additional client setup may be required first because mysql_ssl_rsa_setup by default creates those files in the data directory. The permissions for the data directory normally enable access only to the system account that runs the MySQL server, so client programs cannot use files located there. π To make the files available, copy them to a directory that is readable (but not writable) by clients:
- For local clients, the MySQL installation directory can be used. For example, if the data directory is a subdirectory of the installation directory and your current location is the data directory, you can copy the files like this:
cp ca.pem client-cert.pem client-key.pem ..
- For remote clients, distribute the files using a secure channel to ensure they are not tampered with during transit. π
If the SSL files used for a MySQL installation have expired, you can use mysql_ssl_rsa_setup to create new ones:
- Stop the server.
- Rename or remove the existing SSL files. You may wish to make a backup of them first. (The RSA files do not expire, so you need not remove them.
mysql_ssl_rsa_setupcan see that they exist and does not overwrite them.) - Run
mysql_ssl_rsa_setupwith the--datadiroption to specify where to create the new files. - Restart the server.
π the options (yes, all of them, we don't skip) π
mysql_ssl_rsa_setup supports the following command-line options, which can be specified on the command line or in the [mysql_ssl_rsa_setup] and [mysqld] groups of an option file. For information about option files used by MySQL programs, see Section 6.2.2.2, "Using Option Files".
--help,?β Display a help message and exit.- Command-Line Format:
--help
- Command-Line Format:
--datadir=dir_nameβ The path to the directory thatmysql_ssl_rsa_setupshould check for default SSL and RSA files and in which it should create files if they are missing. The default is the compiled-in data directory.- Command-Line Format:
--datadir=dir_name - Type: Directory name
- Command-Line Format:
--suffix=strβ The suffix for the Common Name attribute in X.509 certificates. The suffix value is limited to 17 characters. The default is based on the MySQL version number.- Command-Line Format:
--suffix=str - Type: String
- Command-Line Format:
--uid=name,-vβ The name of the user who should be the owner of any created files. The value is a user name, not a numeric user ID. In the absence of this option, files created bymysql_ssl_rsa_setupare owned by the user who executes it. This option is valid only if you execute the program asrooton a system that supports thechown()system call.- Command-Line Format:
--uid=name
- Command-Line Format:
--verbose,-vβ Verbose mode. Produce more output about what the program does. For example, the program shows theopensslcommands it runs, and produces output to indicate whether it skips SSL or RSA file creation because some default file already exists.- Command-Line Format:
--verbose
- Command-Line Format:
--version,-Vβ Display version information and exit.- Command-Line Format:
--version
- Command-Line Format:
π COPYRIGHT π
Copyright Β© 1997, 2026, 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/.
π AUTHOR π
Oracle Corporation (http://dev.mysql.com/).
okay that's the whole page bestie, no notes, you ate π«Ά This was MySQL 8.0, dated 03/23/2026 β MYSQL_SSL_RSA_SETUP(1), and that's a wrap π β¨πΈ
π¦ where this page comes from
- fedora 43: mysql8.0-server 8.0.46-1.fc43 Β· GPL-2.0-or-later AND LGPL-2.1-only AND BSL-1.0 AND BSD-2-Clause
- fedora 44: mysql8.0-server 8.0.46-1.fc44 Β· GPL-2.0-or-later AND LGPL-2.1-only AND BSL-1.0 AND BSD-2-Clause
- ubuntu jammy: mysql-server-core-8.0 8.0.46-0ubuntu0.22.04.4 Β· GPL-2.0-or-later
- ubuntu noble: mysql-server-core-8.0 8.0.46-0ubuntu0.24.04.4 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms