【散分---高手接】如何通过SSL启动mysql
创建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.22
Type '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