mysql如何设置ssl连接?

老钱包 老钱包 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
RT!
centos5.5使用yum 安装的mysql5.0.xx

试图ssl链接时候,发现报错
mysql -uroot -p -ssl
mysql: unknown option '-l'

查看ssl是否激活了?

mysql> show variables like '%ssl%';
+---------------+----------+
| Variable_name | Value |
+---------------+----------+
| have_openssl | DISABLED |
| have_ssl | DISABLED |
| ssl_ca | |
| ssl_capath | |
| ssl_cert | |
| ssl_cipher | |
| ssl_key | |
+---------------+----------+
7 rows in set (0.00 sec)

| have_openssl | DISABLED |表明并没有激活这个功能!

以为激活很简单,插入一个字段就可以了!!!
mysql> select ssl_type from mysql.user;
+----------+
| ssl_type |
+----------+
| |
+----------+
1 row in set (0.00 sec)

mysql> update mysql.user set ssl_type="x509" where user="root";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0

重启mysql服务
[root@centos101 opt]# /etc/init.d/mysqld stop
停止 MySQL: [确定]
[root@centos101 opt]# /etc/init.d/mysqld start
启动 MySQL: [确定]


再mysql -uroot -p,傻眼了!!!!密码根本不好用!!!
老是报告:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

直到用
/usr/bin/mysqld_safe --skip-networking --skip-grant-tables &
进入mysql命令行,将x509给去掉!这才能重新登录。。。。

那么如何才能设置mysql的ssl连接呢?
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
老钱包
MySQL 57,062 成员 56,759 内容