How to Fix the Error Establishing a Database Connection in WordPress
Key Takeaways
Fixes the error establishing a database connection in WordPress
Full Transcript
is your site getting the era establishing a database connection in WordPress we'll keep watching I'll show you several different troubleshooting techniques that you can use to fix this problem when we had to do this for our site it took about 20 minutes so go ahead and give yourself a little bit of time to work through these you also want to make sure that you have an FTP client so that you can connect to your website from the back end you can get your login credentials from your hosting provider so this is what it will look like first thing you want to do is make sure that you get an error from the front end as well as the back end when you try and access your admin area if you get something like this then you'll want to try and repair the database to do that connect to your website with your FTP client scroll down and we're looking for our WP config file we want to download this locally and then you can open it with a text editor any text editor will do I have notepad plus plus so I'll use that you want to scroll all the way down to below that's all stop editing and start a new line and we want to paste this bit of code in there this will allow it to try and repair the database so we need to save that and upload it back to our site so go back to the FTP client click upload you want to overwrite this once you add that bit of code head over to this URL and click repair an optimized database and that should fix it if you're still getting the era establishing database connection like you see here then we'll move on to the next step the next thing we want to do is go back to our WP config file and we want to make sure that all of our information is correct specifically all of the database information once you verify that everything looks ok and if you've seen any issues that you've made changes to then go ahead and upload it and try it again if you still see the error then you can change your DB hose from localhost to the actual IP address that works for some people especially people who are running the local server environment so you can try that and then finally you want to check your web host my sequel server if your site gets inundated with a lot of traffic then basically your server just can't handle the requests so that might be what's happening as well this will require you to contact your support for your host and see if they can help you out with that once you've identified and fixed anything with you WP config file go back and see if it works again your site should come back up did you learn something from today's video if so subscribe to our YouTube channel and we'll send more helpful tips to help you manage your WordPress website and thanks for watching
Original Description
Having an error appear on your WordPress site can certainly be terrifying if you don't know what caused it or how to fix it. The most dangerous sounding one can be the error establishing database connection which does not even let you log in to your site. In this video, we will show you how to fix the error establishing a database connection in WordPress.
Text version of this tutorial
http://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/
If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.
Check us out on Facebook
https://www.facebook.com/wpbeginner
Follow us on Twitter
http://twitter.com/wpbeginner
Checkout our website for more WordPress Tutorials
http://www.wpbeginner.com
In this tutorial we will be recommending the use of FTP, for how to use FTP and what it is you would want to take a look at our article:
http://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/
If you wanted to download notepad++ that we used in this video you can find it here:
https://notepad-plus-plus.org/
The solutions we go through are:
- Editing the wp-config.php to pull up the repair prompt
- Checking the wp-congig.php that the connection options are correct
- Editing your MySQL with your host to attempt to fix the error #WordPress #WordPressTutorial #WordPressTips
Watch on YouTube ↗
(saves to browser)
Sign in to unlock AI tutor explanation · ⚡30
Playlist
Uploads from WPBeginner - WordPress Tutorials · WPBeginner - WordPress Tutorials · 0 of 60
← Previous
Next →
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
How to Add Google Search in a WordPress Site
WPBeginner - WordPress Tutorials
How to Display Simple Notices in WordPress
WPBeginner - WordPress Tutorials
How to Bulk Move Posts to Categories and Tags in WordPress
WPBeginner - WordPress Tutorials
How to Create A Question and Answers Site in WordPress
WPBeginner - WordPress Tutorials
How to Add a Subtitle to Posts and Pages in WordPress
WPBeginner - WordPress Tutorials
How to Add a Caption to Images in WordPress
WPBeginner - WordPress Tutorials
How to Show Latest Videos From a YouTube Channel in WordPress
WPBeginner - WordPress Tutorials
How to Check Grammar and Spelling Mistakes in WordPress
WPBeginner - WordPress Tutorials
How to Send A Custom Welcome Email to New Users in WordPress
WPBeginner - WordPress Tutorials
How to Add a Custom Comment Form Title in WordPress
WPBeginner - WordPress Tutorials
How to Add a News Ticker in WordPress
WPBeginner - WordPress Tutorials
How to Add a Full Screen Background Image in WordPress
WPBeginner - WordPress Tutorials
How to Fix Image Upload Issue in WordPress
WPBeginner - WordPress Tutorials
How to Show and Hide Text in WordPress Posts with the Toggle Effect
WPBeginner - WordPress Tutorials
How to Show Page Templates in WordPress Dashboard
WPBeginner - WordPress Tutorials
How to Restrict WordPress Site Access by IP or Logged In Users
WPBeginner - WordPress Tutorials
How to Add Google Translate in WordPress
WPBeginner - WordPress Tutorials
How to Add Custom Buttons with Post Editor Buttons in WordPress
WPBeginner - WordPress Tutorials
How to Fix Featured Images Appearing Twice in WordPress Posts
WPBeginner - WordPress Tutorials
How to Add Tables in WordPress Posts and Pages No HTML Required
WPBeginner - WordPress Tutorials
How to Change the WordPress Database Prefix to Improve Security
WPBeginner - WordPress Tutorials
How to Turn Off Related YouTube Videos in WordPress
WPBeginner - WordPress Tutorials
How to Receive WordPress Emails from Localhost
WPBeginner - WordPress Tutorials
How to Split WordPress Posts into Multiple Pages
WPBeginner - WordPress Tutorials
How to Update URLs When Moving Your WordPress Site
WPBeginner - WordPress Tutorials
How to Crop, Rotate, Scale, and Flip Images in WordPress
WPBeginner - WordPress Tutorials
Image Alt Text vs Image Title in WordPress
WPBeginner - WordPress Tutorials
How to Add Staff Member Profiles in WordPress with Staffer
WPBeginner - WordPress Tutorials
How to Add Custom Fields to Comments Form in WordPress
WPBeginner - WordPress Tutorials
How to Add New Users and Authors to Your WordPress Blog
WPBeginner - WordPress Tutorials
How to Fix WordPress Website Not Updating Right Away
WPBeginner - WordPress Tutorials
How to Show Live Preview of Links in WordPress
WPBeginner - WordPress Tutorials
How to Add Image Icons With Navigation Menus in WordPress
WPBeginner - WordPress Tutorials
How to Use Multiple Themes for Pages in WordPress
WPBeginner - WordPress Tutorials
How to Fix Missing Admin Bar Issue in WordPress
WPBeginner - WordPress Tutorials
How to Add Tabbed Content in WordPress Posts and Pages
WPBeginner - WordPress Tutorials
How to Create Custom Taxonomies in WordPress
WPBeginner - WordPress Tutorials
How to Display a List of Child Pages For a Parent Page in WordPress
WPBeginner - WordPress Tutorials
How to Fix Error Too Many Redirects Issue in WordPress
WPBeginner - WordPress Tutorials
What is the Difference Between Posts vs Pages in WordPress
WPBeginner - WordPress Tutorials
How to Allow User Log In with Email in WordPress
WPBeginner - WordPress Tutorials
How to Display WordPress Widgets in Columns
WPBeginner - WordPress Tutorials
How to Easily Replace Image and Media Files in WordPress
WPBeginner - WordPress Tutorials
How to Add Featured Video Thumbnails in WordPress
WPBeginner - WordPress Tutorials
How to Create a Photo Gallery with Albums in WordPress
WPBeginner - WordPress Tutorials
How to Easily Add Lazy Loading for Videos in WordPress
WPBeginner - WordPress Tutorials
How to Add an Audio Music Player Widget in WordPress
WPBeginner - WordPress Tutorials
How to Create a Wiki Knowledge Base Using WordPress
WPBeginner - WordPress Tutorials
Adding a Post Rating System in WordPress with WP PostRatings
WPBeginner - WordPress Tutorials
How to Clean Up Your WordPress Database for Improved Performance
WPBeginner - WordPress Tutorials
How to Add Character Limit to Post Titles in WordPress
WPBeginner - WordPress Tutorials
How to Add a Private Messaging System in WordPress
WPBeginner - WordPress Tutorials
WWW vs non WWW and Which is Better For WordPress SEO
WPBeginner - WordPress Tutorials
How to Add Voice Search Capability to your WordPress
WPBeginner - WordPress Tutorials
How to Show Real Time Online Users in WordPress
WPBeginner - WordPress Tutorials
How to Create a Duplicate Menu in WordPress with One Click
WPBeginner - WordPress Tutorials
How to Hide a Post From Home Page in WordPress
WPBeginner - WordPress Tutorials
How to Add A Restaurant Reservation System in WordPress
WPBeginner - WordPress Tutorials
How to Add a Border Around an Image in WordPress
WPBeginner - WordPress Tutorials
Beginner’s Guide How to Back Date Your WordPress Posts
WPBeginner - WordPress Tutorials
Related Reads
📰
📰
📰
📰
# Picking What to Read Next: The Trade-offs of Ranked-Choice Voting in a Django App
Medium · Python
The Ultimate Rust ORM Comparison 2026: Diesel vs SQLx vs SeaORM vs Rusqlite — Pick Your Powerhouse!
Medium · Programming
BASIC ARRAY METHODS IN JAVASCRIPT
Dev.to · G Gokul
Beginner projects
Reddit r/learnprogramming
🎓
Tutor Explanation
DeepCamp AI