在 ubuntu 12.04 中打开端口 3306 以允许从任何 ip 连接到 mysql
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/11874518/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Open Port 3306 in ubuntu 12.04 to allow connections to mysql from any ip
提问by user1244772
I have a mysql server running on a server and I wanted to know how to Open a Port 3306 in ubuntu 12.04 to allow connections to mysql from any ip. Can you help? Thanks
我有一个在服务器上运行的 mysql 服务器,我想知道如何在 ubuntu 12.04 中打开端口 3306 以允许从任何 ip 连接到 mysql。你能帮我吗?谢谢
回答by favoretti
I Don't think firewall is your problem. Any modern mysql version has bind-address=127.0.0.1
in its my.cnf
, which makes it bind to loopback only. Comment it out, restart mysql and you should be good to go. Ubuntu doesn't have a restrictive firewall by default IIRC.
我不认为防火墙是你的问题。任何现代 mysql 版本都包含bind-address=127.0.0.1
在其 中my.cnf
,这使其仅绑定到环回。将其注释掉,重新启动 mysql 就可以了。默认情况下,Ubuntu IIRC 没有限制性防火墙。