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 数据库的权限


- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- SQL 临时表问题 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 更改自动增量起始编号? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01