New domain pointed at droplet = "Error establishing a database connection" for all domains

August 6, 2015 2.6k views
Ubuntu WordPress DNS

I currently have a domain and hosting with godaddy. Call this Domain A and Hosting A

I have Domain B which I connected to a droplet (Hosting B) to setup my hosting properly (and migrate everything from Hosting A). I did this successfully.

What I wanted was Domain A (my main domain) connected to Hosting B (the droplet).

I tried adding Domain A in DNS to the droplet in DO (and changing DNS info in godaddy to point at DO DNS) and after a few minutes it propagated and the whole site broke with the error: “Error establishing a database connection”.

Then Domain B also broke and got the error: “Error establishing a database connection” (even though I made no changes to it, it was a result of adding Domain A to the DNS).

In Domain A I was not able to get to phpmyadmin or anything at all because of this error. Root I was able to log in through sftp://DROP.IP.ADDRESS.

I know I made the mistake of not using a SQL DB find/replace to make DOMAIN B into DOMAIN A. I will do that next attempt, but I hope that was not the main issue.

I set everything back to how it was and now Domain A is on Hosting A (godaddy domain to godaddy hosting) and Domain B is on Hosting B (godaddy domain to droplet hosting).

Does anyone know what exact steps I should take to make this domain DNS transfer successful? I will also attempt this at night when my traffic is lowest.

Thanks so much in advance!!!

3 Answers

Is your MySQL server running?

check wp-config file if you are using WordPress.


It seems you’re definitely write. I created a swap file and also did the my.cnf edit as mentioned in this thread:

Mysql does keep crashing. What else should I do?

Have another answer? Share your knowledge.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!