Steps to follow when your WordPress Site spits out an Error Establishing a Database Connection error.
Ten to one the problem is in the wp-config.php file to be found in the public_html folder on the web server hosting your domain.
Step by Step:
- Open Cpanel of your web site (if you are hosted on a linux machine)
- Go to File Manager and navigate to public_html
- Find wp-config.php and download to a PLAIN TEXT Editor
- In Cpanel open up MySQL Databases
- Check that the Database Name and Database User Names are the same
- If not change those values to reflect the values as displayed in MySQL in Cpanel
- At this stage it would be prudent to change the Database Username Password as well via the MySQL screen in Cpanel
- Then save and upload the new wp-config.php file
- If you are New to this then RENAME the existing wp-config.php file to something else BEFORE uploading the new wp-config.php file.
Refresh and check – normally this works first time.
If not, check that you are using a plain text editor and then run a check and repair uitility on the database.
The following two tabs change content below.
Alan Straton
Chief Cook, Bottle Washer and Broom Mechanic at MyPE
Passionate about Port Elizabeth and definitely NOT packing for Perth.
Alan's ethos is epitomised in the words of Nelson Mandela; "I have fought against white domination and I have fought against black domination. I have cherished the idea of a democratic and free society. If need be, it is an ideal for which I am prepared to die."
See more articles by Alan.
Latest posts by Alan Straton (see all)
- The Gold Avenue Flags the 91.67% Krugerrand Seller Mistake - 16 October 2026
- Acepak Showcases Pouch Fillers for Liquid and Food Producers - 16 October 2026
- Osteoporosis Warning Signs and Risk Factors - 16 October 2026
- Osteoporosis Warning Signs and Risk Factors - 16 October 2026
- Wendys Online Puts Timber Quality First for Garden Storage - 16 October 2026
