Knowledgebase: MySQL
Configuring Remote Access for mySQL
Posted by Administrator on 20 September 2005 09:17 PM


As a matter of fact, you can configure your mySQL database to be accessed from any Internet-connected computer you wish! However, you need to configure your mySQL database to accept incoming connections from the computer you'll be accessing from. You can do this in cPanel using the steps below:

Step 1: Log into cPanel.

To log into cPanel, you should go to http://www.yourdomain.com/cpanel/ (where www.yourdomain.com is replaced by your account domain name).

Step 2: Locate and click on the MySQL Databases link on the main screen upon login.

You will see this link after logging in (usually several rows down and towards the middle of the page).

Step 3: Scroll down and locate the Access Hosts section of the page.

This is where you will enter the IP address of the computer needing remote access to your database.

First, you need to know what the connecting computer's IP address is. As a security practice, your mySQL database cannot be connected to by just any PC, but one that is permitted to based on it's IP address.

Determining the IP address

To find out the IP address of the computer needing access to the mySQL database, point the web browser on this computer to http://www.whatismyip.com/ and note the IP address displayed on the screen.

What if my IP address changes?

Some ISPs (Internet Service Providers) change your IP address from time-to-time. If you are on a broadband connection (such as cable modem or DSL), this does not happen all too often. So, you should simply follow the procedures outlined above every time your IP address changes.

However, if you are on a dial-up line, chances are that your IP address changes every time you connect to the Internet. In this case, you can make your life just a little bit easier by using the % symbol in the IP address given in the Access Host field for the parts of the IP address that change (usually the last two sections of the IP address).

Based on your computer's network situation, decide which IP address format you will use and enter this in the single field available to you for Host (% wildcard is allowed).

Step 4: Press Add Host to commit changes.

Now you should be able to connect to your mySQL database from your remote computer.

Connecting to the database remotely

To connect to the database remotely, you will need to connect to mySQL on port 3306. cPanel names databases in the following format:

cpusername_databasename

cpusername: Your cPanel username

databasename: The database you create through cPanel.

Use the above information to connect to your database remotely.

(862 vote(s))
Helpful
Not helpful