允许从任何IP地址远程访问MySQL数据库 [英] grant remote access of MySQL database from any IP address

查看:190
本文介绍了允许从任何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数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆