Having troubles with this and I'm not sure why.. I'm trying to access a mysql database from another server.
I changed the my.cnf file (uncommented the bind-address to access from all):
port=3306 #bind-address=18.104.22.168 local-infile=0 datadir=/var/lib/mysql socket=/var/lib/mysql/mysql.sock user=mysql # Disabling symbolic-links is recommended to prevent assorted security risks symbolic-links=0 # skip-networking
I set up the user, and the user works: (I know "ALL" is bad, but I'm just trying to get this to work...)
GRANT ALL PRIVILEGES ON 'MY_DATABASE'.* TO 'MY_USERNAME'@'22.214.171.124' IDENTIFIED BY 'MY_PASSWORD';
I restarted mysql: /etc/init.d/mysqld restart
I opened up the port from within plesk, and then restarted the whole server. (It's a VPS)
now, when I try and telnet from my desktop, it connects, shows a bunch of garbage text then closes the connection 5 seconds later.
I'm trying to connect with php:
<?php mysql_connect("DOMAIN.COM:3306", "MY_USERNAME", "MY_PASSWORD") or die(mysql_error()); echo "Connected to MySQL<br />";
and I get a "Can't connect to MySQL server" error after a 10 second timeout.
The log files are empty, only showing when I restarted mysqld.
Any ideas or tips on how to troubleshoot this?