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.

Don't let Google's latest Page Experience update derank your business website in search, instead, master Google rankings and website conversions with this Master Class Course by RankYa (Free Lessons Included)

Learn how press here

By RankYa

RankYa is a passionate digital marketer, website optimizer, content creator, and a fully qualified web developer helping businesses of all sizes (big or small) to achieve better results online. We are a reputable and registered Australian business serving valued clients worldwide since 2008, built on hard work, honesty and providing exceptional personalized service

We love sharing our passion through freely available how to videos and courses related to business website marketing and optimization, Google (Search Console, Ads, Analytics, YouTube), SEO, HTML5, Structured Data and WordPress. Thank you for visiting our website. Rest assured that it will serve you well as well.

Leave a comment

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