【散分---高手接】如何通过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
[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
...全文
相关推荐
MySQL 使用 SSL 连接配置详解
本文给大家分享的是如何配置MySQL支持SSL连接方式的方法以及在docker中配置的具体案例,有需要的小伙伴可以参考下
MySQL 8.0开启SSL.docx
MySQL 8.0开启SSL
mysql+ssl配置文档
mysql+ssl配置文档 mysql+ssl配置文档 mysql+ssl配置文档
多种不同的 MySQL 的 SSL 配置
在这篇博客的帖子里,我将会描述不同的使用MySQL数据库的SSL配置方法。 SSL给了你什么? 你可以通过互联网使用 MySQL 复制特性(replication) 或者通过互联网连接到MySQL。 还有可能是你通过企业网去连接,这样会有很多人访问。如果你使用一个自带设备(BYOD)网络,这就更是一个问题了。 SSL在这里通过加密网络防止有针对性的监听。在与正确的服务器进行交互时,可以有效应对中间人攻击(man-in-the-middle attacks)。 你还可以使用SSL客户端证书,让它同密码一起作为身份识别的二要素。 SSL不是唯一的选择, 你可以使用SSH和许多MySQL GUI客户
MySQL配置SSL主从复制
本文给大家分享的是如何给mysql配置SSL主从复制的具体方法,分别给出了5.6和5.7两个版本的实例,希望大家能够喜欢


