sadasdasd

Error Establishing a Database Connection for WordPress site on GoDaddy Server

It all started, when Kosala and I transferred our client’s brand new WordPress site to his GoDaddy server account. We added the domain through ‘Deluxe Windows Hosting’ created a database with user id and passwords, and transferred all the WodrPress files to the domain.

We typed the url gleefully in our browser…and we were greeted with the common message “Error Establishing a Database Connection”

Tried all options

We grabbed the wp-config file and checked the host name, database name, user name and the password; changed the database users and the passwords several times; checked for leading and trailing spaces; re-created the database; changed the host names; googled the error looked at plenty of ‘Solved’ answers, checked forums but to our utter horror, the only advice was to change the config file.

We also thought of installing WordPress on the domain, but as there were several other sites hosted, we did not want to take the risk.

It took us 3 good hours, with no success. Feeling utterly useless, we closed up for the weekend. During the weekend the thought of the server kept popping up in my mind and I kept dreaming of goDaddy Plesk panel. It was not a great weekend at all!

Solved

On Monday, we roped in Arosh to the grievance. Luckily he did not try to simulate the problem from scratch. We went through the options individually on our own machines and saw a possible new option. Hey how come we saw it now! Arosh being a calmer and a cooler guy than both of us, I entrusted the whole burden onto him.

  1. He got our client to advice GoDaddy to remove the newly added domain from the ‘Deluxe hosting’ and started from scratch.
  2. Selected the ‘WordPress Managed Sites’ option. Added the domain as a brand new domain (by clicking on the +Add Site button on the top right side corner on the screen for managing WP sites), and transferred the files, attended to the themes and the standard stuff in WordPress. Also I must mention, that in this setup we used the option of installing a clean WP installation using the Godaddy’s WP installer. As godaddy creates its own config file to track the site.
    After installing WP, we used the FTP details and started uploading the files (wp-content) of our copy of the site, without tampering with other WP files or folders. We changed the prefix to the one we have in our db on the wp-config.php and used the phpMyadmin (I must say, it was a pretty outdated version) and uploaded the sql file.
  3. Not to mention, that it took us ages to ftp the files to the client’s server, as there was no Plesk/File manager access to WordPress hosted sites

And Hey Presto!! It worked!! A big thank you to Arosh!

So in future, if transferring WordPress sites to GoDaddy, we will remember to set it up as a managed WordPress site and not any other.

Point to take special note: