[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 '123 ';
Grant all privileges on mydb2. * To 'd _ admin' @ '% 'identified by '123 ';
Grant all privileges on mydb2. * To 'bodd' @ '192. 168.18.14 'identified by 'domainssl' require SSL;
Flush privileges;