Remote Access to MySQL Database for WordPress

by oscar on 2009/09/11

Here’s a quick visual tutorial on how to connect to a Remote MySQL Database, using MySQL Administrator.

These instructions should be compatible with all hosts that allow remote connections to MySQL and have CPanel. Most hosts I’ve dealt with, offering C-Panel allow this type of connection, but YMMV.  Check their documentation, or just try my tutorial. If their documentation isn’t clear, or the tutorial I wrote doesn’t match what you see with your webhost. Let your webhost know, or you can ask for help in the comments.

Works in all 3 major platforms

You can use this for MySQL Administrator in Mac, Linux & Windows

The Goal here is to: Connect to your WordPress Database on a regular webhost such as Liquidweb.com using MySQL Administrator. You can probably configure other webhosts which offer C-Panel and MySQL with minor tweaks to the instructions, and really it doesn’t have to be a WordPress Database.

It should take you about 5-10 minutes to complete

Get your external IP Address

If you’re connecting to a remote webserver, you most likely will need your external IP Address.

Get your external IP

It should be something like NNN.NNN.NNN.NNN where each “N” is a number from 1 to 254.  Down below you’ll see the same number in a slightly different format: ipnnn-nnn-nnn-nnn.your.service.provider.com. That’s it! That’s your IP Address. Note it down, you’ll need it shortly.

Add your IP Address to the Remote MySQL

Log into your CPanel and add Databases, then click on Remote MySQL. The next screen will let you enter the IP Address you got from ipchicken. Type in the address and click “Add Host.” Make sure there are no spaces before or after the address.

CPanel Database Options

Verify your IP Address was added

After you enter the address in there, you should see it listed under “Access Hosts.” This tells the MySQL Server that your IP Address is allowed to connect remotely. You’ll need to change this if your IP Changes periodically.

Access Hosts

Please note that you might want to do the previous step only when you need to access your database remotely. As with any other service that is available on the internet, having a port open can potentially lead to someone trying to hack your server. Please Please Please note that I said POTENTIALLY. It isn’t a trivial thing to do, but if you’re paranoid you could just activate this for the time when you need to work on your database then remove the IP when you’re finished.

Configure a new MySQL Administrator Connection

Assuming you’ve already installed MySQL Administrator, you now need to create a new connection. Start the program, and click on the “…” next to the Stored Connection data field. This will take you to the screen you see below and you can configure your connection information there.

MySQL Administrator Connection Info

Usually, the fields are the same as you have for CPanel. Username usually matches the one you use to login to your webhost’s cPanel. Password is also generally the same.  Hostname could be different in different cases, your best bet and most defaults is the same as your domain, e.g. www.example.com. Schema is the database name.

Use the Stored Connections Dropdown to connect

To Connect, select your connection from the Dropdown

Using the dropdown menu from the MySQL Administrator, you can select the configuration you just created and be on your way to MySQL Administration bliss. If you like using a program in your Desktop, and prefer graphical interfaces (GUIs) instead of text-only or web applications, this is what you need.

Go crazy in there looking around

Access to Databases

Just don’t start changing things you’re not sure about. This is one of many ways of administering your MySQL database, and it works particularly well for WordPress Installations. A companion to MySQL Administrator is MySQL Query Browser which allows you to actually run queries against the databases so you may change many fields at once, or do special queries from your desktop. This works both on Windows and Mac, and if memory serves me well even Linux.

What can you actually do with this?

A few of the things you can get done with this are:

  • Changing many posts at once with a MySQL query.
  • Running a query to see how many plugins you have installed.
  • Auditing your database to make sure you haven’t been hacked.
  • Making a Backup (use the Schedule Tab under Backup for automatic nightly backups)
  • Restoring your database from a backup after a problem.
  • Exporting registered users for an external report.
  • Learn the WordPress Database structure.

Looking for a good webhost that I recommend?
>>Dreamhost, Use Promo Code MYSQLREMOTE or visit them with this link To Sign up and get up to $77.00 off. That's a great deal if you're ready. You can also start a Free Trial. (non-affiliate link)
>> JustHost, I wrote this tutorial on a Justhost.com account. Get started right here. They're fast, highly recommended and I like them so far (non-affiliate link)
>> LiquidWeb, My Favorite new host. Get started right here. LiquidWeb has what they call Heroic 24/7 support, so far I'm impressed and have been getting help quickly each time I need it. (non-affiliate link)
>> Bluehost, Decent webhost, my least favorite of the four, but good enough. Check them out their offerings right here. (non-affiliate link)

Please share this post if you found it useful. You can use one of the buttons below to Tweet it, send it to FaceBook, or LinkedIn, or save it to other locations. Your comments and feedback is also welcome!

  • Facebook
  • Evernote
  • Twitter
  • StumbleUpon
  • Read It Later
  • Yahoo Messenger
  • Google Reader
  • Google Buzz
  • LinkedIn
  • Mixx
  • Slashdot
  • LiveJournal
  • Share/Bookmark

Possibly Related posts:

  1. How I do a semi-automatic glossary on WordPress
  2. How to evaluate a WebHost
  3. How to Completely Uninstall WP-e-commerce shopping cart plugin.

{ 4 comments… read them below or add one }

David September 11, 2009 at 10:50 AM

Great article. Screenshots are a tremendous help. Thanks.

Reply

Liseth September 12, 2009 at 7:26 AM

Wow! fantastic information! I did not have any idea how to use this feature! The step by step instructions and the pictures made a lot easier for me to understand!
Thank you so much! great info!

Reply

JimmyBean September 30, 2009 at 11:37 PM

I don’t know If I said it already but …I’m so glad I found this site…Keep up the good work I read a lot of blogs on a daily basis and for the most part, people lack substance but, I just wanted to make a quick comment to say GREAT blog. Thanks, :)

A definite great read..Jim Bean

Reply

Caroline June 29, 2010 at 5:18 AM

Thanks a lot for yet another first-rate WordPress tutorial. I am always trying to find great WordPress tutorials to suggest to my clients. Thanks for posting this tutorial . It’s exactly what I was trying to find. Truly great post.

Reply

Leave a Comment

Comments links could be nofollow free.

Previous post:

Next post: