MySQL:未在授权中显示SSL

时间:2019-03-08 20:35:16

标签: mysql

MySQL 8在REQUIRE SSL输出中未显示SHOW GRANTS

在MariaDB上,当我使用REQUIRE SSL创建用户时,它会显示在授权中:

Server version: 10.2.22-MariaDB MariaDB Server

MariaDB [(none)]> drop user if exists 'test'; 
MariaDB [(none)]> create user 'test' REQUIRE SSL;
Query OK, 0 rows affected (0.00 sec)

MariaDB [(none)]> show grants for 'test';
+----------------------------------------------+
| Grants for test@%                            |
+----------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'%' REQUIRE SSL |
+----------------------------------------------+

但是在MySQL8中,我看不到REQUIRE SSL表示:

mysql> drop user if exists 'testu';
mysql> create user 'testu' REQUIRE SSL;
mysql> show grants for 'test';
+----------------------------------+
| Grants for test@%                |
+----------------------------------+
| GRANT USAGE ON *.* TO `test`@`%` |
+----------------------------------+

尝试不使用SSL进行连接确实会产生错误,但是如果授权中未显示该信息,我如何查看启用了该功能的用户呢?

1 个答案:

答案 0 :(得分:2)

mysql [localhost:8014] {msandbox} ((none)) > show create user 'test';
+--------------------------------------------------------------------------------+
| CREATE USER for test@%                                                         |
+--------------------------------------------------------------------------------+
| CREATE USER 'test'@'%' IDENTIFIED WITH 'caching_sha2_password' REQUIRE SSL ... |
+--------------------------------------------------------------------------------+

请参见https://dev.mysql.com/doc/refman/8.0/en/show-create-user.html