
- #ERROR ESTABLISHING A DATABASE CONNECTION HOW TO#
- #ERROR ESTABLISHING A DATABASE CONNECTION INSTALL#
If you already have a backup of a restore point when your site was working, go ahead and restore your site.
#ERROR ESTABLISHING A DATABASE CONNECTION HOW TO#
You can check out How to Manually Backup Your WordPress Website for details on how you can backup your site in this situation. If things get worse, you can at least go back to where you started. It’s better to have a backup of a slightly broken site than nothing at all. Before You Get Started: Back up and Restore!īefore you make any changes to your site to try and fix this error, it’s a good idea to back up your entire site as-is just in case. Start with the first one and work your way down the list since it starts with the most common solutions and progresses to the more complex issues and fixes. If you’re reading this, chances are you are experiencing this error right now and you’re keen to try the fixes below right away.
#ERROR ESTABLISHING A DATABASE CONNECTION INSTALL#
How to Install XAMPP and WordPress Locally on PC/Windows.How to Move WordPress for Local Development with XAMPP.Migrating WordPress from a XAMPP Localhost to the Web.You can check out some of our other posts for details on how to test changes before pushing them live: That’s why it may be helpful to mention that testing changes before you publish them could help you avoid this situation in the future. Sometimes the error could come up after making some changes to your site that seem innocent enough until they take everything down. There could be a malfunction with your server or it’s overloaded.Your files or database may be corrupted.You may have plugins or themes installed that are causing the issue.Your file permissions could be set incorrectly.There’s a conflict with the database prefix.You could have the wrong credentials entered.The database may have been deleted by accident.You may have made an error installing WordPress or migrating it.Since this is the case, the trickiest part of fixing this error is figuring out exactly what caused it.īeyond not being able to connect to your database, here are more specific reasons behind what may have caused this error:

Your PHP files are unable to connect to your database and there could be many reasons for it. “Error establishing a database connection.” If something’s wrong with your database, your PHP files can request information from your database, but when your database doesn’t respond back by serving up the requested data, you’re left with the error: Both sets of information are then put together so your site can be displayed when a browser asks for the page to load.

Your PHP files are built to request this information from your database and your database sends this information along to your files. Your MySQL database stores much of the data that displays on your site such as usernames, passwords, posts, categories, tags and other content. Your site can be seen as having two main parts to it: Your files and your database. What Is This Error and How Does It Happen? I recommend starting at the top of the list of solutions and working your way down until your site is back up.


Read on to find out more about this error, how it happens and how to fix it. In any case, you’ll be happy to know it’s usually one of the simpler WordPress errors to resolve. In most cases, this error appears because the credentials you entered for your database aren’t correct, you made a mistake installing or migrating your site, or your database tables are corrupted. If WordPress is throwing up a message telling you “Error establishing database connection” on an otherwise blank page, it means your database cannot be reached.
