grant remote access of MySQL database from any IP address(授予从任何 IP 地址远程访问 MySQL 数据库的权限)
问题描述
我知道这个命令:
GRANT ALL PRIVILEGES
ON database.*
TO 'user'@'yourremotehost'
IDENTIFIED BY 'newpassword';
但是它只允许我授予一个特定的 IP 地址来访问这个远程 MySQL 数据库.如果我想要它以便任何远程主机都可以访问这个 MySQL 数据库怎么办?我怎么做?基本上,我将这个数据库公开,以便每个人都可以访问它.
But then it only allows me to grant a particular IP address to access this remote MySQL database. What if I want it so that any remote host can access this MySQL database? How do I do that? Basically I am making this database public so everyone can access it.
推荐答案
TO 'user'@'%'
% 是通配符 - 如果需要,您还可以执行 '%.domain.com'
或 '%.123.123.123'
以及类似的操作.
% is a wildcard - you can also do '%.domain.com'
or '%.123.123.123'
and things like that if you need.
这篇关于授予从任何 IP 地址远程访问 MySQL 数据库的权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:授予从任何 IP 地址远程访问 MySQL 数据库的权限


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