Connecting to SQL database from external server

5 posts / 0 new
Last post
#1 Sat, 09/24/2011 - 19:39
cronjob78

Connecting to SQL database from external server

Hello everybody,

Just had my host migrate my website to a new server. Previously on my last server I allowed some external websites connect to a specific database on my SQL server via a specific SQL user. I need to know how to set this up via virtualmin.

under Servers > Mysql database server i have set up user permissions, database permissions and host permissions but I still cannot connect. In the dbinfo.inc.php file on the external server I am using the IP address of my server as the hostname.

Is there some additional setting in virtualmin I must change to allow these connections? E.g. some setting in 'MySQL System Variables'?

I found some older threads on the forum but most seem to be a little out of date.

Thanks in advance for any help.

Sat, 09/24/2011 - 19:45
andreychek

Howdy,

What error is it that you're getting?

However, you'd want to start by going into Edit Databases -> Remote Hosts for the domain that owns the database, and add the IP addresses of the servers who will be connecting to the database.

-Eric

Sat, 09/24/2011 - 20:17
cronjob78

it wont connect. "unable to connect"

added remote host as suggested but no luck.

Sat, 09/24/2011 - 21:43
andreychek

Howdy,

By default, MySQL doesn't listen for remote connections. So if you didn't already, the other thing you'd need to do is go into Webmin -> Servers -> MySQL -> MySQL Server Configuration, and set "MySQL server listening address" to something like "0.0.0.0", and then click "Save and Restart MySQL".

-Eric

Mon, 09/26/2011 - 05:49
cronjob78

Thanks for the replies. Ive had to send a ticket to my hosting company. Hopefully theyll be able to sort it out within a few days. Ill post here if I get info on a solution.

Topic locked