Can I connect remotely to MySQL database?

Yes! it is possible. For this you have to allow remote access from your control panel, by adding your IP to the access hosts in mysql screen there. If you do not have a fixed IP at your end you can use % as wild card and allow remote access from anywhere.

Then for remote connection you have to use the server IP or your domain IP or domain name instead of localhost in your script/program.

For example, to connect remotely via mysql command line utility:

mysql -h x.x.x.x -u USERNAME -p DATABASE

(where x.x.x.x is your server ip, USERNAME is the db user, and DATABASE is the database name)

NOTE: Whenever an IP/Host is added or removed from the Access Host field, the privileges need to be reassigned to the database user on that database otherwise it will produce Access Denied error.

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Can I run a PHP forum (message board) on my site?

Absolutely! In fact we’ve pre-installed it for you. All of our hosting accounts include...

Do you allow IRC?

No. We do not allow IRC on our network on any plans or servers.

Do you have curl installed in your php?

Yes. Latest stable version.

Do you have netPBM installed?

This is set up on all of our servers. This is in the usual place as all of our binaries:...

How can I Flush DNS cache?

In Microsoft Windows: In Microsoft Windows, you can use the command ipconfig /flushdns to flush...