Home > Software > Connecting to MySQL on remote machine

Connecting to MySQL on remote machine

I just installed Ubuntu 11.04 on a machine that I was using as a shared XBMC database server.  It was the same machine that I was using before.  I backed up the database and restored it on the new machine, but when I went to use XBMC it wouldn’t connect to my shared database.  I tried doing the following from a XBMC machine:

ERROR 2003 (HY000): Can't connect to MySQL server on '###.###.###.###' (111)

After a bit of time on Google I found the solution.  It appears that they changed the security in the latest version of MySQL.  It used to be a setting called skip_networking which had to be set to off, they have since added the bind-address setting in the MySQL my.cnf file.

sudo nano /etc/mysql/my.cnf

You will need to find the bind-address setting and comment it out. Save and exit the file, and then restart MySQL.

sudo /etc/init.d/mysql restart

After that I could connect to the remote database, which was on my LAN. Please note that should take care to make sure that your server isn’t accessible from the outside, e.g. stay behind a firewall.

Categories: Software Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.