Synchronizing the remote and the local database can be more difficult. Since professional hosters have their database servers behind firewalls, you will in most cases be denied access to the remote database. One option is to let your hoster know your IP. The he can add an exception to his firewall to let you through. This solution will only work if you're connecting from a location with a static IP. Once a firewall exception is set up, you can use your domain name as the hostname for the MySQL server.
There is another option using PuTTY http://www.putty.org/ If your account includes SSH access, you can set up an SSH tunnel to forward a port on your local computer to the hosters MySQL server. The MySQL traffic will be encrypted and he don't need to change the firewall rule. Ask wich port your hoster uses for SSH connections.
This procedure function on my Vista laptop:
Open PuTTY. In the Category pane of the application window, select the "Tunnels" option found under Connection->SSH. In the main pane, in the "Port Forwarding" section, do this:
- By Source Port, add the port that you would like to forward e.g. 3306 for mysql.
- By destination, type the hostname you want to connect to e.g. yourdomain.com
- At the end of the hostname, add a colon followed by 3306, e.g. yourdomain.com:3306 (the radio buttons under the destination can be left as Local and Auto)
- Click add.
- Click on the session in the category pane.
- Enter the hostname your want to connect to (yourdomain.com) and the port you got from your hoster.
- Click open and log into the session.
- You can verify if PuTTY has set up the port forwarding correctly by looking at the PuTTY Event Log. To do this, click on the Windows icon in the upper left corner of the menu bar in your open SSH session (small green icon on a black background that can be difficult to see). There from the drop down menu select Event Log, in which you should see if the connection is ok.
- For more information please see the PuTTy user manual , especially the section on Port Forwarding.
You should now be able to connect to port 3306 at localhost and it will be fowarded to the remote MySQL server.
If it is impossible to synchronize the local and the remote database, you have no other option than dumping the database as a sql file via the phpMyAdmin export tool or via the wp-db-backup or similar plugins.