I am using PHP and MySQL to make a database connection, the only change is that I am trying to access my remote server from my local computer using my server IP address.
mysql_connect("x.xx.xx.x","username","password") or die(mysql_error());
and the error I am getting is Unable to connect to the given host. The user has all privileges and rights.
Most default installs of MySQL only listen to the local machine.
Look for the
bind-addresssetting inmy.cnfon the server, and make sure it’s listening on the IP address you’re targetting. You may also need to ensureskip-networkingisn’t switched on!Alternatively (and less securely!) the following will set it up to listen on all addresses – local and remote: