Grab Your Free 17-Point WordPress Pre-Launch PDF Checklist:

Grab your free 10-Point WP Security Checklist:

Error establishing database connection is a very common error that I bet every WordPress user has encountered at some point. Luckily the fix is very easy and there are two ways to fix it.

Nearly every time this error is caused by incorrect or incomplete database information in your wp-config.php file or no linking the database user to the database.

Let’s tackle the first one first.

Incorrect or incomplete database information in your wp-config.php

All you have to do here is double check your MySQL database name, database username and the database user password. Make sure the credentials you have in the wp-config.php match exactly to the ones you created.

If you’re not sure where to find the ones you created, log into your cPanel account.

Then click on MySQL databases. That will show you all the database in your hosting account. Find the correct on for the wp-config.php file you’re working on. Make sure the db name matches what’s in the file.

Then find the db username you have linked to that database and what’s in the wp-config.php file matches exactly what’s associated with your database.

If you don’t remember the password, or have it noted somewhere, you can generated a new password for the user and put that into the wp-config.php.

While you’re here, you can make sure that the second possible reason for the error is taken care of.

At the bottom of the MySQL database page you will be able to link the database user to the database. Make sure they are linked and the correct privileges are set. If you’re unsure of the proper privileges, choose them all.

Now save the db user to database association. Save the wp-config.php file you were updating.

Then go to the page that was generating the error establishing database connection error and reload that page. Everything should be working normally now.

I hope this information helps you! If you have any questions leave a comment below or ping me @WPLearningLab on Twitter.

————–

If you want more excellent WordPress information check out our website where we post WordPress tutorials daily.

Connect with us:

WP Learning Lab Channel:

Facebook:

Twitter:

Google Plus:

Pinterest:

Nguồn: https://madisonrep.org

Xem thêm bài viết khác: https://madisonrep.org/cong-nghe

48 Comments

Jalitza Nuñez

May 22, 2020

Thanks!! This video makes my day happier

Reply

WATCH AND LEARN

May 22, 2020

Thank you soo much sir my problem has been sole….

Reply

Potat0 Chip

May 22, 2020

I did this with a subdomain but it still doesnt work 🙁

Reply

Lee-ann Duarte

May 22, 2020

Huge help, Thank you

Reply

Bathtub Bulletin

May 22, 2020

Thank you so much. It worked!

Reply

hacker dk

May 22, 2020

thank you boss!!!

Reply

Gopal kumawat

May 22, 2020

Thank you. Very much

Reply

Majid Showghi

May 22, 2020

Thanks. You solved my issue 🙂

Reply

ernesto a

May 22, 2020

I updated my WordPress and apparently my database was deleted :S Is there a solution? I don't know if there's a way to create again the database or something, I don't have a backup of it, so perhaps I'm screwed. Your videos always have save me, thanks so much for this content!

Reply

Junaid Ahmed Baloch

May 22, 2020

Thank you, it works. I'm using localhost and was unable to create a database. this video helps me

Reply

Charles Richet

May 22, 2020

Thanks from Brazil!!!

Reply

Aman Silawat

May 22, 2020

thank you bro…

Reply

Jatin Sain

May 22, 2020

Thank you 🙂

Reply

M Löv

May 22, 2020

I noticed that everytime i try to add or edit something on my website, it gets cut off and then i get this error message, it useually disappears in a while, but it wastes a lot of time because i have to wait until i can use my website again , really boring.

Reply

TallBoy876

May 22, 2020

I'm running localhost with this same issue. Went to the database and did like you instructed and it works. Thank you so much. I didn't experience this issue with the same setup on other machines.

Reply

Camilo Andrés

May 22, 2020

Thanks, this video fixed my day!

Reply

Akash Aqib

May 22, 2020

Hi, When I install wp rocket speed up plugin into the WordPress & save changes, then it shows this database error. any reason for that, I am wired now. pls, help.

Reply

MrFemo89

May 22, 2020

thanks a lot! Worked perfectly

Reply

Mike Bravo

May 22, 2020

ty!

Reply

Trinath Pattanayak

May 22, 2020

Thanks

Reply

Josi

May 22, 2020

I am really worried my website was completely normal I haven't worked on this for many days, but yesterday I open and it was normal. Today I got the error 408 timeout request and then later "Error establishing a database connection". Then later open normally. I check and I have this database username(like on your video). Can this happen again? I am worried because this site is for a client and he bought his hosting with a third company that doesn't give me full access to the admin panel, probably because they have many websites there. Just weird.

Reply

Quamar Roshan

May 22, 2020

hello sir
actually I was used wordpress database reset after that it's showing

""""""""Error establishing a database connection

If your site does not display, please contact the owner of this network. If you are the owner of this network please check that MySQL is running properly and all tables are error free.

Could not find site www.xxxxxxxxxx.info. Searched for table wp_blogs in database i5368684_wp1. Is that right?

What do I do now? Read the bug report page. Some of the guidelines there may help you figure out what went wrong. If you’re still stuck with this message, then check that your database contains the following tables:

wp_users

wp_usermeta

wp_blogs

wp_signups

wp_site

wp_sitemeta

wp_registration_log

wp_blog_versions"""""""

What can I do now????????????
Please help me

Reply

Quizziin

May 22, 2020

Thanks !! Really helpful !!

Reply

Jay Bernardo

May 22, 2020

Hello, can you help me to fix this error? /wp-includes/class-wp-hook.php on line 286. thank you in advance

Reply

Gh Go Online

May 22, 2020

Thanks so much, i spent the last 4 hours trying to fix this until you came my way

Reply

Waqas Ahmad

May 22, 2020

not working for me

Reply

Vlad Romanov

May 22, 2020

Did not work 5/3/2018

Reply

AfricanFlightStar

May 22, 2020

I've found some of your videos useful, but this one – Sorry, but this is not clear. The explanation of exactly how to select he correct database from many in a list, and then add a new user and password, and then tie that user & password to the wp-config.php file, was not made clear. In fact it seemed like you edited the video and cut out your voice for a second right when you were explaining how to add a new user.
I have a older 2015 copy of my GoDaddy WP website which I'm trying to load into a new GoDaddy hosting account now, and although I followed all your well explained steps in your very good video on how to manually upload /reinstall a WP website, I still can't get the old site to link into the new installation of WordPress. I'll keep looking for a solution.

Reply

CosmetologyFoodNFashion

May 22, 2020

How do I get to the CPanel? Please I need HELP! I'm getting an error message saying, Error establishing a database connection

Reply

Seftezey

May 22, 2020

How do i get cpanel

Reply

Top APPS

May 22, 2020

sir please help me i sent my wordpress acount please recover it

Reply

Top APPS

May 22, 2020

bro iam using 000webhost but my sql isnt seen plz fix

Reply

Sir Kostas

May 22, 2020

Thank you very much!!

Reply

John Bill

May 22, 2020

Thank you, you're amazing!
Keep it up.

Reply

ManuAlvarado22

May 22, 2020

Awesome!

Reply

Michael Mayo

May 22, 2020

I've already did this, and also i have a correct setup wp-config. .but still came up with this error..

Reply

Stavro Xhardha

May 22, 2020

I still call it the white screen of death 😛 ANW thank you very much

Reply

Romy Kim

May 22, 2020

I realized my problem. I got a zip file from previous designer and realized he used long address(?) like http://….. instead of simply page name. So, it screws up everything on localhost. Is there any quick way to fix this ?

Reply

Romy Kim

May 22, 2020

Wow. You saved me. Somehow, my problem isn't yet gone, but got me a step closer. I was about to quit this job. Thank you !!!!

Reply

Cary Huff

May 22, 2020

Bjorn,
You don't know how you saved me. I can't thank you enough.

Reply

How To learn

May 22, 2020

Hello
Actually in my sql database it is showing
Create New Database
Current Databases
MySQL Users
Add New User

how to solve the issue

Reply

Aryan Sharma

May 22, 2020

Sir Help Me Please
My Website Hqpoint.org get 5-10 times Error 502 Bad Gateway in a day after installing any plugin .^_^;
please give me solution😅😅😅😅

Reply

Aryan Sharma

May 22, 2020

sir when I apply these settings nothing happens. error not fixed

Reply

Shishir Udupa

May 22, 2020

how to do this thing in AWS pls can u upload a video

Reply

imobeus1

May 22, 2020

You're the shit!!
Thanks for uploading!

Reply

Jacques van Wyk

May 22, 2020

I want to kiss you(no homo) lol thx

Reply

Tolulope Dahunsi

May 22, 2020

WOW works like a charm with just one click. the error occured after i deleted the contact form7 plugin from wordpress dashboard. still wondering why this happened. Pleaselet me know if u have any idea. Thanks

Reply

Zeeshan Dehlvi

May 22, 2020

brother i m using xampp localhost .. so my problem is I have copied my whole wordpress website folder from ftp server to Xampp localhost .. it is showing the same error . what should i do now .

Reply

Leave a Reply