How to Fix Error Establishing a Database Connection in WordPress

WordPress CMS logo

It is a common issue and one that is actually part of running modern WordPress built website to have Errors connecting to databases. WordPress is a dynamic content management system that resides in a Database (usually MySQL) and there are many different ways you can troubleshoot Errors when establishing a Database Connection for websites built on WordPress.

First Step for Fixing Database Connection Errors

Realize that more often than not, this error has nothing to do with your WordPress site but rather the web hosting service you are using may be down temporarily (e.g. server reboot, maintenance or upgrade). That means first thing we should do is double check if the MySQL server is up and operating normally and that you can login to phpMyAdmin.

To check this, simply login to your web hosting and find cPanel. Look for DATABASES and Press on phpMyAdmin. You should be able to login to your Database where your WordPress installation resides in. phpMyAdmin Check

Check MySQL in cPanel

MySQL Databases check Simply browse in to your MySQL Database options to see if your Database WordPress is built upon is visible. Then explore database user options and password, you should see both the Database Name and the User of that Database.

Default WordPress configuration file named wp-config.php contains information for connecting to Database. Check to see if everything matches with your installation. wp config php file WordPress database settings

Other Database Connection Errors You May Encounter for WordPress

If you are not able to login to MySQL server using phpMyAdmin and get funny messages such as Error: 2002 CR_CONNECTION_ERROR. Then, its best that you first contact your web hosting provider to resolve the matter. Or perhaps visit MySQL Client Error Codes and Messages section.

How to Fix Error Establishing a Database Connection in WordPress Video Lesson

Once again, database connection errors are usually normal for a short period of time, if you’ve followed all the troubleshooting procedures and you still see Error Establishing a Database Connection Message in your internet browser. Then, triple check any plugins connecting to your database (disable any new plugin you installed), check Database User privileges or contact your web hosting provider as they will be able to assist you further.

By RankYa

RankYa is a digital services provider dedicated to growing your sales and business website's results. Highly experienced technical problem solver, Google products expert with proven 'Social Media Marketing' skills, RankYa (100% Australian Owned and Operated) is dedicated to helping small businesses to grow.

We're looking forward to contributing towards your online success. Contact Us.

Questions? Leave a Comment!

Your email address will not be published. Required fields are marked *