The following document describes how to configure SSL for MySQL. This document describes how to configure SSL for MySQL based on the actual application code, I hope you will be helpful in your future studies.
- [client]
- ssl-ca=$DIR/cacert.pem
- ssl-cert=$DIR/client-cert.pem
- ssl-key=$DIR/client-key.pem
- [MySQLd]
- ssl-ca=$DIR/cacert.pem
- ssl-cert=$DIR/server-cert.pem
- ssl-key=$DIR/server-key.pem
6. Test MySQL startup
- $ DIR is the path of the Option file my. cnf
- Shell> MySQLd -- defaults-file = $ DIR/my. cnf &
- Then invoke a client program using the same option file:
- Shell> MySQL -- defaults-file = $ DIR/my. cnf
- [Root @ localhost MySQL-5.0.20a] # chown-R root/usr/local/MySQL
- [Root @ localhost MySQL-5.0.20a] # chown-R MySQL/usr/local/MySQL/var
- [Root @ localhost MySQL-5.0.20a] # chgrp-R MySQL/usr/local/MySQL
- [Root @ localhost MySQL-5.0.20a] #/usr/local/MySQL/bin/MySQLd_safe -- user = MySQL &
- [Root @ localhost MySQL] #./bin/MySQL-u root -- socket =/tmp/MySQL. sock
For a service, you only need to put MySQL/share/MySQL. server under/etc/init. d/and change it to MySQL.
- [root@localhost MySQL]# chmod 775 /etc/init.d/MySQL
- [root@localhost MySQL]# chkconfig --add MySQL
- MySQL> grant all privileges on mydb.* to 'admin'@'%' Identified by '123456';
- grant all privileges on mydb2.* to 'd_admin'@'%' Identified by '123456';
- GRANT ALL PRIVILEGES ON mydb2.* TO 'bodd'@'192.168.18.14' IDENTIFIED BY 'domainssl' REQUIRE SSL;
- flush PRIVILEGES;
The above content is an introduction to configuring SSL for MySQL. I hope you will gain some benefits.