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)
- Just Some Tools Packs Six Clamps and a Pressure Card for Highveld Glue-Ups - 26 November 2026
- Phase Converters Sets Out How to Size a Rotary Unit From the Motor Plate - 26 November 2026
- Set-IP Puts Trade Mark Renewal Dates on a One-Page Wall Sheet for Makers - 26 November 2026
- From the Boot of a Car to Comrades Gold: 32GI, the South African Sports Nutrition Brand for Everyone - 25 November 2026
- How Toxic Stress Affects a Child’s Brain and Development - 25 November 2026
