Linode Forum
https://forum.linode.com/

Allowing remote connections to mysqld
https://forum.linode.com/viewtopic.php?f=19&t=3467
Page 1 of 1

Author:  karsh [ Thu Aug 21, 2008 6:18 pm ]
Post subject:  Allowing remote connections to mysqld

Hi,

I have a linode with 2 ips and a mysql server running but no matter what I try, I can't connect it from the outside, not even telnet it.

$ mysql -h 70.85.31.xxx -u test
ERROR 2003 (HY000): Can't connect to MySQL server on '70.85.31.xxx' (110)

$ telnet 70.85.31.xxx 3306
Trying 70.85.31.xxx...
telnet: connect to address 70.85.31.xxx: Connection timed out
telnet: Unable to connect to remote host: Connection timed out

$ telnet 67.18.186.xxx 3306
Trying 67.18.186.xxx...
telnet: connect to address 67.18.186.xxx: Connection timed out
telnet: Unable to connect to remote host: Connection timed out

My mysql server is working fine with connections from inside. I don't have 'skip-networking' in my my.cnf.

I'm using firehol for firewalling and is set to allow connections to port 3306. But even stopping firehol, it won't allow connections. Httpd, ftpd, sshd, etc.. are working just fine.

Anyone knows what the problem is?

Thanks.

Author:  Boone [ Thu Aug 21, 2008 7:04 pm ]
Post subject: 

Check the /etc/mysql/my.cnf file for the line starting with bind-address.

It's set to 127.0.0.1 by default, you need to change that to your public IP in order to connection from the outside world.

(May vary a bit depending on your version of mysql, distro, etc)

Author:  karsh [ Fri Aug 22, 2008 11:39 pm ]
Post subject: 

That did the trick :D

Thanks Boone!

Author:  Xan [ Sat Aug 23, 2008 1:33 am ]
Post subject: 

I find it's easier (and gives me better peace-of-mind) to tunnel MySQL connections over SSH. That way, I don't have to open a new port (especially one so juicy a target), and I don't have to worry about configuring MySQL for either SSL or non-local networking. YMMV.

Page 1 of 1 All times are UTC-04:00
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/