以下的文章主要介紹的是MySQL配置SSL的實際操作步驟,此文章主要是以其實際應用代碼來引出MySQL配置SSL的實際操作流程,以下就是具體內容的描述,望在你今後的學習中會對你有所幫助。
- [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. 測試啟動MySQL
- $DIR 是選項文件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
對於設置為服務只要把MySQL/share/MySQL/MySQL.server放到/etc/init.d/下改名為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;
以上的相關內容就是對MySQL配置SSL的介紹,望你能有所收獲。