如何启用对MySQL Server的外部访问? [英] How do I enable external access to MySQL Server?
问题描述
如何启用对MySQL Server的外部访问?我可以在本地连接,但不能从网络上的另一个盒子连接.
How do I enable external access to MySQL Server? I can connect locally but I cannot connect from another box on the network.
我刚刚尝试
grant all privileges on *.* to root@'%' identified by '*****' with grant option;
并重新启动MySQL Server,但未成功.
And restarted MySQL Server with no success.
推荐答案
您可能必须编辑配置文件(通常是my.cnf)才能在外部接口中侦听,而不是仅在本地主机上侦听.
You probably have to edit the configuration file (usually my.cnf) to listen in the external interface instead of on localhost only.
将bind-address
参数更改为机器的IP地址.
Change the bind-address
parameter to your machine's IP address.
如果这是旧的MySQL安装,则应注释掉skip-networking参数.
If this is an old MySQL installation, you should comment out the skip-networking parameter.
然后,重新启动MySQL,您将被设置
Afterwards, restart MySQL and you'll be set
这篇关于如何启用对MySQL Server的外部访问?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!