Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/68.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Mysql 启用ssl后拒绝访问_Mysql_Ssl - Fatal编程技术网

Mysql 启用ssl后拒绝访问

Mysql 启用ssl后拒绝访问,mysql,ssl,Mysql,Ssl,我是MySQL的新手,我正在尝试在MySQL版本5.5.6中启用SSL。 我遵循了此链接中的步骤 在执行步骤5之前的步骤之后,我可以看到在执行查询时启用了SSL: show variables like '%ssl%'; +---------------+----------------------------+ | Variable_name | Value | +---------------+---------------------------

我是MySQL的新手,我正在尝试在MySQL版本5.5.6中启用SSL。 我遵循了此链接中的步骤

在执行步骤5之前的步骤之后,我可以看到在执行查询时启用了SSL:

show variables like '%ssl%';

+---------------+----------------------------+
| Variable_name | Value                      |
+---------------+----------------------------+
| have_openssl  | YES                        |
| have_ssl      | YES                        |
| ssl_ca        | /etc/certs/ca.pem          |
| ssl_capath    |                            |
| ssl_cert      | /etc/certs/server-cert.pem |
| ssl_cipher    |                            |
| ssl_key       | /etc/certs/server-key.pem  |
+---------------+----------------------------+
create user 'ssluser'@'%' identified by 'sslpassword' REQUIRE X509;
现在我无法执行查询:

show variables like '%ssl%';

+---------------+----------------------------+
| Variable_name | Value                      |
+---------------+----------------------------+
| have_openssl  | YES                        |
| have_ssl      | YES                        |
| ssl_ca        | /etc/certs/ca.pem          |
| ssl_capath    |                            |
| ssl_cert      | /etc/certs/server-cert.pem |
| ssl_cipher    |                            |
| ssl_key       | /etc/certs/server-key.pem  |
+---------------+----------------------------+
create user 'ssluser'@'%' identified by 'sslpassword' REQUIRE X509;
但我得到了信息:

 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'REQUIRE X509' at line 1
所以我在后面执行了这个查询:

CREATE USER 'ssluser'@'%' IDENTIFIED BY 'sslpassword';
GRANT USAGE ON *.* TO 'ssluser'@'%' REQUIRE X509;
FLUSH PRIVILEGES; 
现在我已经执行了此操作,并且启用了SSL,当我尝试以“ssluser”身份登录时,无论是否使用证书和密钥,我都被拒绝登录:

mysql -u ssluser -p 

其中:

ERROR 1045 (28000): Access denied for user 'ssluser'@'localhost' (using password: YES)
因此,我很困惑这是如何工作的,比如用户是否应该使用证书和密钥登录。用户是否被授予Require X509必须并且应该使用证书和密钥登录?任何帮助都将不胜感激。提前谢谢