7

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

user1244772
  • 294
  • 4
  • 9
  • 22
  • 2
    Assuming iptables, and my memory is pretty hazy, but something vaguely like: `iptables -A INPUT -p tcp --dport 3306 -j ACCEPT`. Am not sure how safe opening your MySQL to the world is though. Also, you're probably going to get better responses on superuser.se since it's a bit offtopic here. – Corbin Aug 08 '12 at 23:10

1 Answers1

16

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.

favoretti
  • 29,299
  • 4
  • 48
  • 61