About a remote MySQL connection

About a remote MySQL connection

Is your PHP script on your computer, or on a remote server, and your database hosted by 2MHost?

You can connect to our server using the server IP (which appears in the admin panel as a server name) and port 3306. Then, to allow your computer (or the server that hosts the php script) to access the database on our server, you may have to do the following:

1. Add the IP address of the server that you are trying to connect from to the list of 'access hosts' in the 'MySQL databases' page in your account cPanel.

2. It is recommended to re-add the users to the databases to ensure that the correct access permissions are applied.

Is your script on our server and your database hosted elsewhere?

This is a potentially problematic option. This process is allowed, but we provide very limited support for it, for many reasons:

1. When you contact the remote MySQL server, the server will try to open a random port to respond. Our firewall will usually block this connection.

2. The remote MySQL server may block our server if you try to connect to it many times in a short amount of time.

3. We do not know the server settings of this remote database server, so we will not be able to tell you why you may have timed out, got disconnected, or didn't get the result that you expected.

Again, it is highly recommended that you have us host your database so we can help you solve any problems you might encounter.

Last update on: 2009-10-11 04:41:51