Many web hosting providers do not use DNS to provide you access to your database, in such cases the database is only accessible by the files residing on your hosting account.
Tip: If you are using localhostas your database host, your database can only be accessed by files hosted on your web account.
There are several tools such as phpmyadmin, which will allow you to access your database through the web, but many users may still prefer to access the database from their favorite desktop client. In this post we will show you, how you can easily access database confined to your website / blog from your desktop.
The earlier host for Techie Buzz, provided us access using DNS, using which we could backup and keep tabs on it from our desktop. But since we moved to a new server, we did not have access to it and we used some of our expertise to access the database from our desktop. We are more than glad to share the same with our readers and thousands of people who read us.
Note: You will need to have SSH access to your hosting account to make full use of this tutorial, even if you don’t have one you can bookmark this for a later date when you do have SSH access.
Here are a couple of tools we will be using in this tutorial so keep them handy.
- Putty The most famous and free Telnet and SSH Client.
- MySQL Query Browser Our favorite MySQL client.
You may use your own favorite tools to replace the ones we are using.
How Can You Access the Remote Database From Your Desktop?
Before we go ahead with showing you how to access your blog or website database offline we would like to enlighten you on how we will be achieving it. We will be using a age long trick of bridging two computers by creating a tunnel between them (wiki), which will allow you to send data packets between both of them using one of ports.
In short we will help you in setting up one of your local ports to communicate with the database port on your webhost account. Once you have created the tunnel, you will be able to access the remote database from your desktop.
Setting Up The Tunnel
We will be using the first tool Putty to create a tunnel between the two machines. Here is a Techie Buzz production that shows you how you can do that easily.
As you can see from the video, it is quite simple to setup a tunnel to any remote host. You just have to key in the host name and setup a port to where the tunnel has to be created to.
In the next part of the tutorial, we will show you how you can easily access the remote database from your local desktop, using your favorite database browser.
Do feel free to contact us if you have any questions or queries.