以下的文章主要介绍的是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的介绍,望你能有所收获。
【编辑推荐】