Question

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

Posted August 6, 2015 2.9k views
UbuntuWordPressDNS

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!!!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
3 answers

Is your MySQL server running?

check wp-config file if you are using WordPress.

@Woet

It seems you’re definitely write. I created a swap file and also did the my.cnf edit as mentioned in this thread: https://www.digitalocean.com/community/questions/mysql-on-ubuntu-keeps-crashing

Mysql does keep crashing. What else should I do?

Submit an Answer