How to require SSL for all remote users(如何为所有远程用户要求 SSL)
问题描述
给定一个有多个远程用户的 MySQL 系统(形式为 'joecool'@'192.168.1.2' 的用户);是否有 SQL 语句可以用于为所有远程用户
REQUIRE SSL
?
Given a MySQL system with multiple remote users (users of the form 'joecool'@'192.168.1.2'
); is there a SQL statement I can use to REQUIRE SSL
for all the remote users?
单用户命令是:
GRANT USAGE ON *.* TO 'joecool'@'192.168.1.2' REQUIRE SSL;
拥有所有用户"版本会特别有用,因为 phpMyAdmin 不支持 REQUIRE SSL 标志创建或修改用户时.
Having an "all user" version would be especially useful because phpMyAdmin doesn't support the REQUIRE SSL flag when creating or modifying users.
推荐答案
Honza(以前)接受的答案似乎不正确,请参阅其评论.自 GRANT 查询同时更改多个用户grant-accounts-passwords" rel="noreferrer">MySQL 不支持用户名的通配符.
The (formerly) accepted answer by Honza seems incorrect, see its comments. It seems not possible to use a GRANT
query to alter multiple users at once since MySQL does not support wildcards for user names.
正如您自己建议的那样,您可以使用 UPDATE
查询直接更改 mysql.user
表中的记录,并按照 Marc Delisle 的建议,然后使用以下方法刷新特权:
As you suggested yourself you can alter records in the mysql.user
table directly using an UPDATE
query and as Marc Delisle suggested, afterwards flush priviliges with:
FLUSH PRIVILEGES;
另见 dba.stackexchange.com > 如何授予多个用户权限.
这篇关于如何为所有远程用户要求 SSL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如何为所有远程用户要求 SSL


基础教程推荐
- 带有WHERE子句的LAG()函数 2022-01-01
- 从字符串 TSQL 中获取数字 2021-01-01
- 使用 VBS 和注册表来确定安装了哪个版本和 32 位 2021-01-01
- MySQL 5.7参照时间戳生成日期列 2022-01-01
- while 在触发器内循环以遍历 sql 中表的所有列 2022-01-01
- CHECKSUM 和 CHECKSUM_AGG:算法是什么? 2021-01-01
- 如何在 CakePHP 3 中实现 INSERT ON DUPLICATE KEY UPDATE aka upsert? 2021-01-01
- MySQL根据从其他列分组的值,对两列之间的值进行求和 2022-01-01
- 带更新的 sqlite CTE 2022-01-01
- ORA-01830:日期格式图片在转换整个输入字符串之前结束/选择日期查询的总和 2021-01-01