
Ever have your WordPress blog stop working with a database connectivity problem when you shifted hosting or changed the IP address of your server? This has happened to me numerous times -especially when using WordPress as a platform for an Intranet. Changing the IP address of the server for any reason has devastating consequences. This post deals with self hosted instances of WordPress on your own Linux server or on that of your web host. I have used MySQL query browser to access the WordPress database. You can also do this through PHPmyadmin or any other database editing tool. If you are proficient with MySQL commands, you can do this instead from the MYSQL command prompt on the server console or through SSH. In addition to this you need FTP or SSH access to your server for editing the WordPress configuration file wp-config.php.

Edit the 'wp-config.php' in the root of your WordPress installation directory. In this screenshot I am using Winscp (from a Windows machine). You can also use SSH (Putty from Windows) or FTP for the same.
As shown in the above screenshot, replace your old host name with the new one. In my case, the host name is an IP address. Remember that this host name is not necessarily the link to your website -unless both your database and web server are running on the same machine. This hostname is the name/IP address of your database (MySQL ) server. So you should change this only if you’ve changed your database server as well. In my case, everything is running on a single server, so when I change its IP address, I need to change the database host here too.
From here onwards, I am using the MySQL query browser for editing the WordPress database options table. As mentioned before, you can also do this through phpmyadmin or through the MySQL command prompt or any other tool which lets you connect either locally or remotely to your MySQL server. The MySQL query browser has been now replaced by the MYSQL Workbench, but is still easier to use that the more comprehensive MySQL Workbench.
Connect to the server with a user account that has read/write access to the database.
Now you need to scroll down until you come to the option_name home.
For the option_name home, repeat what you did in Step 4 above, and then click on the Apply Changes button (next to the Edit button) to save your changes.
This should get your WordPress blog up and running again
If you would like to make a comment, please fill out the form below.