Cpanel / MySQL Access Hosts
Let's say you're developing a script on your PC at home, and you need to connect to your database remotely using a
MySQL admin program. No problem. This procedure is a little quirky, but here are the steps to grant remote access to your database.
(note, if you don't have a database yet, start
here)
We'll assume you are using the following information:
database: example_mydb
database user: example_dbuser
IP address given to your computer from your ISP: 1.2.3.4 (
how do I find this?∞)
server name∞: server.asmallorange.com (with IP address 5.6.7.8)
Access Hosts
First, login to Cpanel and click
MySQL Databases
Then, scroll down to Access Hosts
Enter your IP address (eg, 1.2.3.4) in the field next to
Host (% wildcard is allowed):
Click
Add Host
You can enter something like 1.2.3.% if you want to allow a range if IP addresses (this is not safe; it will allow anyone in that entire network range to have access to your database if they are able to obtain your password)
Remove User from Database
Currently, the database user only has access through localhost, so you need to force it to recognize the IP address.
Scoll up to the
Current Databases and look for the database example_mydb
Careful now, you'll see two delete buttons, one next to the database name (example_mydb) and one under that next to the username (example_dbuser).
Click the Delete
next to the database username.
The next screen says:
Account Removed from Access List
Deleted the user example_dbuser from the database example_mydb.
Click go back.
Add User to Database
Scroll back down to
Add Users to Your Databases
Select the user example_dbuser from the drop-down menu on the left and the database example_mydb from the drop-down menu on the right.
Click
Add User to Database
Testing your Connection
Now, using your PC and remote
MySQL client, enter the connection information for your database, database user, and the server name or IP address.
If you run into problems with any of this, double-check the steps above or send in a
support ticket∞ for assistance.
Back to New User Documentation
There are no comments on this page. [Add comment]