Error Establishing Connection to Database

My hosting company decided to migrate my VPS to a new server with a new dedicated IP Address without advanced warning. This of course caused my multisite network to go completely down. Once I changed my dedicated IP Address in my CLoudflare DNS settings, my frontend site went back up. However, if I visit the login page for WordPress, I'm receiving the error: "Error Establishing Connection to Database."

I'm not sure what to do from here. How can I fix this? Please help, I have customers who are now becoming very upset with us.


  • Adam Czajczyk

    Hey Timothy,

    Hope you're well!

    This error is most likely caused by change in the database access credentials. From what you're saying I understand that your frontpage isn't powered by WordPress and that error occurs only when visiting the WordPress part.

    There can be a few reasons why this is happening. First of all you need to login into your admin panel of your hosting account and check if the database actually exists. I'd also check what is the current host name for database access as many hosting providers doesn't allow using "localhost" instead of something like "" or even IP address.

    You may also try this: open wp-config.php file in an editor, find "define('DB_HOST', 'localhost');" - please note that insead of "localhost" you may see a host name or IP Addres - and change "localhost" to new IP Address.

    If it doesn't help I recommend contacting your hosting support team, they should know what they've changed and how to fix resulting problems.


Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.