Remote SQL connections

Status
Not open for further replies.

Time

Active Member
239
2010
31
0
I have a website and a VPS, I want the website to be able to access the SQL databases (version 5.5.8) running on the VPS.

I've tried using the GRANT ALL PRIVILEGES command, it didn't seem to do anything.

command:
Code:
GRANT ALL PRIVILEGES ON *.* TO 'SITE'@'178.239.62.125' IDENTIFIED BY 'MY-PASSWORD';

Error from the webpage trying to access the databases:

Error: Unable to connect to MySQL server. MySQL server is offline or you dont have access to connect to it or username/password is wrong.

MySQL reported: Lost connection to MySQL server at 'reading initial communication packet', system error: 110.

Suggestions:
1) Recheck your MySQL username and password in website's config.php file.
2) Try start MySQL server on your host, maybee there is no connection.
3) Give 'admin' rights to user (SITE) that you using to connect to MySQL.

Thanks.
 
7 comments
You just need to make sure the mysql server on the vps is set to allow connections from external addresses.

Check mysql.cf, most likely it is only set to bind to localhost.

You also need to allow anyhost to connect to it and this can be done via phpmyadmin.
 
I've opened up the ports on the firewall.

I can't seem to find the right mysql.cf file, what directory is it in?
 
Status
Not open for further replies.
Back
Top