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连接呢?