创建ssl文件(客户端和服务端):
[root@localhost newcerts]# dir
ca-cert.pem client-cert.pem client-req.pem server-cert.pem server-req.pem
ca-key.pem client-key.epm my.cnf server-key.pem
在链接mysql的时候进入mysql[root@localhost newcerts]# mysql --ssl=1 --ssl-ca=@PWD/cacert.pem --ssl-cert=@PWD/client-cert.pem --ssl-key=@PWD/client-key.pem -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 31 to server version: 5.0.22Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
可是查看'Ssl_cipher'是空值:mysql> SHOW STATUS LIKE 'Ssl_cipher';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Ssl_cipher | |
+---------------+-------+
1 row in set (0.00 sec)
应该怎么设置森哥帮帮忙!
另外我在启动服务的时候:
[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" start --defaults-file=$DIR/my.cnf[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" start --defaults-file=$DIR/my.cnf
Starting MySQL: [ OK ]
[root@localhost newcerts]#
但是换一下位置就报错,mysqld不能加参数吗?
[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" --defaults-file=$DIR/my.cnf[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" start --defaults-file=$DIR/my.cnf start
-bash: [root@localhost: command not found
另外我的cnf文件内容如下:
[root@localhost newcerts]# vi my.cnf
[client]
ssl-ca=/var/lib/mysql/newcerts/cacert.pem
ssl-cert=/var/lib/mysql/newcerts/client-cert.pem
ssl-key=/var/lib/mysql/newcerts/client-key.pem
[mysqld]ssl-ca=/var/lib/mysql/newcerts/cacert.pem
ssl-cert=/var/lib/mysql/newcerts/server-cert.pem
ssl-key=/var/lib/mysql/newcerts/server-key.pem
[root@localhost newcerts]# dir
ca-cert.pem client-cert.pem client-req.pem server-cert.pem server-req.pem
ca-key.pem client-key.epm my.cnf server-key.pem
在链接mysql的时候进入mysql[root@localhost newcerts]# mysql --ssl=1 --ssl-ca=@PWD/cacert.pem --ssl-cert=@PWD/client-cert.pem --ssl-key=@PWD/client-key.pem -u root -p
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 31 to server version: 5.0.22Type 'help;' or '\h' for help. Type '\c' to clear the buffer.mysql>
可是查看'Ssl_cipher'是空值:mysql> SHOW STATUS LIKE 'Ssl_cipher';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| Ssl_cipher | |
+---------------+-------+
1 row in set (0.00 sec)
应该怎么设置森哥帮帮忙!
另外我在启动服务的时候:
[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" start --defaults-file=$DIR/my.cnf[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" start --defaults-file=$DIR/my.cnf
Starting MySQL: [ OK ]
[root@localhost newcerts]#
但是换一下位置就报错,mysqld不能加参数吗?
[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" --defaults-file=$DIR/my.cnf[root@localhost newcerts]# "/etc/rc.d/init.d/mysqld" start --defaults-file=$DIR/my.cnf start
-bash: [root@localhost: command not found
另外我的cnf文件内容如下:
[root@localhost newcerts]# vi my.cnf
[client]
ssl-ca=/var/lib/mysql/newcerts/cacert.pem
ssl-cert=/var/lib/mysql/newcerts/client-cert.pem
ssl-key=/var/lib/mysql/newcerts/client-key.pem
[mysqld]ssl-ca=/var/lib/mysql/newcerts/cacert.pem
ssl-cert=/var/lib/mysql/newcerts/server-cert.pem
ssl-key=/var/lib/mysql/newcerts/server-key.pem
http://dev.mysql.com/doc/refman/5.1/zh/database-administration.html#secure-connections5.8.7. 使用安全连接
5.8.7.1. SSL基本概念
5.8.7.2. 需求(OpenSSL)
5.8.7.3. 使用yaSSL
5.8.7.4. 为MySQL设置SSL证书
5.8.7.5. SSL GRANT 选项
5.8.7.6. SSL命令行选项
5.8.7.7. 用SSH以远程方式从Windows连接到MySQL
<img src="http://forum.csdn.net/PointForum/ui/scripts/csdn/Plugin/001/face/27.gif" alt="" />
http://blog.chinaunix.net/u/29134/showart_1715948.html