๐ ๏ธ Fix Error Establishing a Database Connection in WordPress ๐ป
Key Takeaways
The video tutorial provides step-by-step solutions to fix the "error establishing a database connection" issue in WordPress, covering methods to check database information, database host information, repair the WordPress database, and check if the database server is down, using tools like FTP clients, file managers, and Duplicator.
Full Transcript
if you've just seen this error when trying to visit your wordpress site do not worry because in this video we're going to look at a few solutions to how we can solve it and get your site back up and running [Music] hey my name's ryan i'm from wpbeginner and i completely understand how frustrating this error can be none of the solutions in this video may seem a little technical but please do not worry because we're going to go through it step by step and all the resources and links are in the description below now before we get into the solution let's look what causes this issue now this is a pretty common problem when someone tries to move their website from one host to another or install another instance of wordpress and there are three things that can cause this error one you have incorrect database information in your wordpress settings two the database is corrupt or three there is an issue with your database server at this point you're probably asking what is the database and what's that got to do with wordpress well wordpress is a content management system and wordpress uses a database to store your content and website data when a user visits your website wordpress then connects to the database and shows them the content wordpress needs a few things to connect to the database it needs a database name it needs a database username it needs a database password and a database server wordpress stores all this information in a wordpress configuration file or a wp config file now if any of the information in that wp config file is incorrect wordpress can't connect to the database now that brings us nicely to our first method so method one is to check your database information to do that we need to find our wp-config file and check the information in it there are a couple methods we can use to access the file we can either use an ftp client or a file manager through our hosting control panel for this video i'm going to make it nice and easy and use a file manager through my hosting control panel but if you want to use an ftp client there is a link to a fantastic article that'll help you get set up with an ftp client ok when you're ready we'll jump right in once you've logged into your hosting dashboard you need to look for the file manager in bluehost it's under the advanced tab and then we can find the file manager under the file section here click on that that's going to open up a new tab and what we're looking for is the public underscore html folder and then we need to scroll to find the wp config file once you've found the wp config file right click on it and download it to your computer so i've downloaded wp-config file and opened it in the simple text editor to find the information that we need now i've blanked out some of this information for this video but the information we're looking for is right here database settings database name database username and database password now we need to double check these with our hosting control panel so we're going to go back over to the hosting control panel go back to the advanced tab and what we're looking for this time is the mysql databases which is right here under databases now again some of this information is blanked out but essentially you'll be able to find this information if you're looking under your mysql databases so right here we have current databases so we have the database name the database username and if we scroll down from here we can see the current usernames and actions we can change the password so we can change the password and then go back to our wp config file and put the new password in here so just double check all this information is same as what you have in your my sql databases and then upload it to your website method two is to check your database host information most wordpress hosting companies use localhost for your database host but some don't so the best thing to do is to contact your hosting provider and ask for that information method three is to repair our wordpress database if you see a different error message when you try and access the back end and log into your website then you'll need to repair your wordpress database to do this open up your wp config file in your text editor again scroll to the bottom of the page find this line that's all stop editing happy publishing above that just insert this line of code which is available in the description below save that file then come back over into your file manager find the original wp config file delete that and then go to upload select the wp-config file that you've just edited and then visit this link this can also be found in the description just make sure you change your site.com to your actual site url click on repair and optimize database just so you know this may take a while when you can access the site go back and remove the line of code from your wp config file now if you've got this far in the video and all your information seems to be correct but your website's still throwing up an error our fourth method is to check whether our database server is down this can happen if your site experiences heavy traffic and your server can't handle the amount of visitors at that point your website will seem really really slow and it may throw up the error to some users the best course of action is to contact your hosting company and ask if your mysql server is down if you want to check for yourself then follow these steps let's jump right in head back to the hosting dashboard and find the file manager and click on that make sure we're under the public html folder and create a file called testconnection.php make sure that's saved under the public html folder and create a new file scroll down to the file and click on edit that file now you want to paste the following lines of code and before we save this we want to change the username and the password to the username and password for our database click save changes after you've done that try and connect to the script using the following link again just change the url to your website url if the script connected successfully then it means that your user has sufficient permission and there is something else that is wrong go back to your wp config file to make sure that everything there is correct i really hope this video is able to help you out and get your site back up and running but if the solutions in this video didn't work then the next thing you should do is ask for some help the first thing i would do is reach out to your hosting provider and ask if they can help troubleshoot the issue some really good hosting providers will even solve the problem for you another thing you can do is contact a wordpress developer now we recommend going through codeable as they're professional trusted and they have wordpress developers on there that can help you out for a reasonable price if you want more tips on fixing wordpress errors then check this video out thanks for watching
Original Description
In this video, we go step-by-step through how to fix the "error establishing a database connection" issue when visiting a WordPress website.
Get Duplicator https://duplicator.com/
We break down the issue, what causes it to happen and how you can troubleshoot and fix it yourself with the tools available in your hosting control panel.
โบ Looking for the code & link mentioned in the video? Its in the full written tutorial here: https://www.wpbeginner.com/wp-tutorials/how-to-fix-the-error-establishing-a-database-connection-in-wordpress/
โบ How to Use FTP to Upload Files to WordPress for Beginners
https://www.wpbeginner.com/beginners-guide/how-to-use-ftp-to-upload-files-to-wordpress-for-beginners/
โบ Related video - How to Solve Error Too Many Redirects Issue in WordPress (4 Methods)
https://youtu.be/Yg3OCoz7Fo8
Timestamps
0:00 Intro
1:36 Method 1: Check Your Database Credentials
3:39 Method 2: Check Your Database Host Information
3:51 Method 3: Repair WordPress Database
5:03 Method 4: Check if Your Database Server is Down
--Top Resources--
โกUse Promo Code WPBVIPโก
โบBest WordPress Contact Form Plugin https://wpforms.com/wpbeginner
โบBest WordPress Analytics Plugin https://www.monsterinsights.com/
โบBest Lead Generation Plugin https://optinmonster.com/
โบBest WordPress SEO Plugin
https://aioseo.com/
โบBest Theme Builder for WordPress https://www.seedprod.com/
--Related Videos--
โบWordPress Tutorial - How to Make a WordPress Website for Beginners https://www.youtube.com/watch?v=DvbFBxKcORA
โบWordPress Gutenberg Tutorial: How to Easily Work With the Block Editor https://www.youtube.com/watch?v=JjfrzGeB5_g
โบWhat is SEO and How Does it Work? https://www.youtube.com/watch?v=JjfrzGeB5_g
โบHow to Install a WordPress Theme https://www.youtube.com/watch?v=ZIPQRQLAz90
If you liked this video, then please Like and consider subscribing to our channel for more WordPress videos.
https://www.youtube.com/subscription_center?add_user=wpbeginner
Follow us on Twitter:
https://twitter.
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
๐ฐ
๐ฐ
๐ฐ
๐ฐ
DuckDB vs PostgreSQL: I Ran the Same Query on Both. One Finished in 12ms. The Other Timed Out.
Medium ยท Programming
Stop Using GROUP BY for Real-Time Leaderboards: How to Track the Top 10 Sales Performers Across 100โฆ
Medium ยท Programming
Form 4 transaction codes, and why 1 in 5 insider sales isnโt a sale
Medium ยท Data Science
Data Lake vs Data Warehouse vs Data Lakehouse: A Simple Guide for Java Engineers
Medium ยท Data Science
Chapters (5)
Intro
1:36
Method 1: Check Your Database Credentials
3:39
Method 2: Check Your Database Host Information
3:51
Method 3: Repair WordPress Database
5:03
Method 4: Check if Your Database Server is Down
๐
Tutor Explanation
DeepCamp AI