How To Fix “Error Establishing A Database Connection” In WordPress
HTML-код
- Опубликовано: 24 авг 2024
- Learn how to fix “Error Establishing A Database Connection” on your WordPress blog!
Blog post: www.elegantthe...
Linked mentioned: www.yourwebsite.com/wp-admin/maint/repair.php
Like us on Facebook: / elegantthemes
2:16 lost me. Thanks for showing us how smart you are.
Thank you, I was able to repair my database and get my site back online using your tutorial
Thanks Bro... First Option didn't work but the second worked instantly.
Great Tutorial, straight to the point... Sweet.
I didn't give my new database privileges and the MySQL databases allowed me to do that thank you.
Thank you!!! Learning about the wp_options table in the database was a lifesaver for me.
Nice! Glad to hear it helped 👍
THANK YOU SO MUCH! IT WORKED! I modifed my SQL database and that error popped up after the update! THANK YOU AGAIN!!!!
Thank you, this tutorial saved my nerves and brought my site back to life! :)
OMG thank you so much problem fixed with the first option,,,, you are genius among men.
Thanks for the fix! Editing the wp-config.php file was exactly what I had to do. Working great now. Life saver.
Any help pls, im using vultr vps server and i faced this issue and i cant repair it im confused , should i connect my server with FTP like filezilla or i should enter to that by PUTTY .PLS ANYONE CAN HELP .THANKS IN ADVANCE
Thank you SOOO MUCH for this! Was freaking out after trying to fix it for hours and this worked like a charm! 👍🏼
This video makes too many assumptions. In my case I've only just created a DB so it can't be incorrect and there is no corruption because there's nothing in ( no tables ), I've copied and pasted the username and password so I know they're correct and yet wordpress still gives me the message "Error Establishing A Database Connection"
did you manage to fix it? i'm having this same annoying issue for some time now and can't seem to find an answer. a fresh install and still an error in connecting to the database which is on localhost...
this message annoys me do you know how to stop it and fix
@@ed101poti Always test with a fresh new user with all privileges
Did anyone figure this out? helppp
Same issue, anyone found the solution?
I don't have wp-config.php not even in the zip I downloaded from WordPress.org
Thank you! Had this for 2 days, had to create a new user name as you show and now it works.
Thanks first option worked. U r legend
This a good brief video to the point. Only thing is PDO connection seems to be the standard now as Mysqli is deprecated in most hosts. Also line2 of test code has a typo: $test Connection should be $testConnection. In my case, everything was set up ok but didn't work. I had to create a new user and assign to the database for WordPress to work. Then I deleted the old user. Always try that before trying to repair the database.
I have just restarted my server and the website works well now!
This video indirectly helped me solve my problem. The issue was with the config.php file. Thanks!
Dude, you are freaking amazing!! I had a user to my site email me about getting this when the search functionality was used. I noticed it also appearing for other spots on my WordPress blog too. I emailed support, but got no response. I figured since it was almost Christmas I'd be SOL. However, after trying your test-connection code, I was able to get an idea of what was wrong and fix the issue. Anyway, thanks for making this video!
Amazing! I had troubles with this after moving hosts and the repair code (and repairing database) worked perfectly. Thanks so much!
the same here
Thank you!! Your video helped me fix my issues even tech support from my hosting company couldn't fix :) appreciate it!
can i just say you are the best?!!!!!
You are soo good, thanks a million times buddie.
Mine was a simple WordPress PHP thing repair. Thank you, solved my problem :)
This helped me to address my issue.
i had previously changed my cpanel name and this changed the username of all my databases. so i logged in to my cpanel, root directory of my website and edited the wp config file and put the correct username of my databases. i first checked the username of my databases using the cpanel file manager.
Data base repair works for me!
Thank you!
Thanks a lot. You are a life savior.. and job savior too!
Any help pls, im using vultr vps server and i faced this issue and i cant repair it im confused , should i connect my server with FTP like filezilla or i should enter to that by PUTTY .PLS ANYONE CAN HELP .THANKS IN ADVANCE
I am really very grateful to you bro... Heartily thanks from India...
Many thanks, when i fix it, i solved the problem, thanks guys
Line 2: @4:34 should be $testConnection
Thank you so much buddy... You're a life saver
Great explanation for non-techies 👍
Thanks man, really needed this.
Thanks god for people like you. You saved my life :D
Any help pls, im using vultr vps server and i faced this issue and i cant repair it im confused , should i connect my server with FTP like filezilla or i should enter to that by PUTTY .PLS ANYONE CAN HELP .THANKS IN ADVANCE
What I need to know is what directory the sql file goes in on the server. I’m having to migrate my word press site manually. Due to upload file size limit. What directory contains the SQL file?
You saved my life my man! Thanks
You're welcome Manu! 😄
Hi. I was able to restore the database. Very good information. Thanks!
thanks for your help it did work as you said
Thank you so much 👍
WONDERFUL VIDEO!,, THANK YOU, WORKED LIKE A CHARM!..
I get big traffic spike, I get this error, but server was up. so what should I do in this case?
it comes for some time, then the site working.
you give solution for 1 and 2. What about 3?
Great video and troubleshooting tips 👍
what if I can't find the wp-config file in phpmyadmin ? it's nowhere to be found and I can't go forward with troubleshooting :(
Thanks, worked perfectly for me!!
Thanks a lot. U help me a lot!!! I'm a beginner
Thank you. It was helpful.
I'm trying to run my wordpress in localhost so I can make a few changes and upload again via FTP.
But when I downloaded the files I'm receiving this error because I don't have that database. How may I get the wordpress database and have it locally?
Thanks man!!!
Thank you so much! This happened to me today and I followed your instructions and all is good now! Again, thanks! Great video!
Hi, i Don undrestand his english, will you help me pls what is actually he done
I dont have wp-config file
I didn't understand where to create a new file, help me plz
The site was doing fine until "Error establishing a database connection" appeared in rare occasion the site could be accessed sometimes not is it the site problem?
That did it, repairing the wp-config-php file fixed my problem, thanks!
Dear this is a wonderful tutorial ... keep on your great work ...
Thank you that worked for my website
YESSS!! Thank you so much!
非常感谢!爱来自中国
Thanks! config repair works just fine
Thank you for this tuto. So I can't connect me to the database. After did every steps, the error still appears :'(
I made it with WAMP, maybe do you think 'll be different with XAMPP ?
Thank you so much
Thanks Man. Best video :)
You're welcome!
Worked! Thank you!
Thanks so much for this fixed my issue
Hey thanks for video tips,
But I have an issue when I go to the phpnyadmin and navigate to the wp-options of the current database
I'm not able to see the site url instead there's something else.
What could be the reason for this ?
Thanks in advance.
Thanks a lot
really great this video. Congrats.
Thank you for this informaion .
This really helped! Thanks
thank you so much
Was so helpful 😭😭
Thanks,worked for me
Someone please help me..I am unable to resolve my error..I have tried everymethod nothing seems to work in my case.
I have a question if I’m on a website and error establishing data connection it it something on my side or should I just wait for the website to fix itself
Thank u so much repairing worked
good job
actually i am new to wordpress my database connection is not established via wordpress.org showing some connectivity error and i also not having config.php file its config-sample.php what should i do
things i have tried making other user to the database and give previliges but same error message is shown
and with installation of wamp server i got marinedb as well
Hi even after pasting code in wp-config file, this site repair page is not working
same
just in case anyone lost the wp-config file like I did. when recreating it (making sure u have the right credentials for the database inside it) set the correct permissions for it. 0600 in my (and most likely your) case. cheers
THANKS
It worked Yay, thanks.
A few days ago i click on ''empty'' on wp_option in phpmyadmin.. Now i don't have siteurl and home in phpmyadmin. I checked everything and try with wp allow repair, but when I remove this code, again is the same ''Error Establishing A Database Connection'' I try to add a new user, and update wp-config, still the same. I make this testconenction.php and when i start it says: Connection successfully. Debug log is ''mysqli_real_connect(): (28000/1045): Access denied for user '****''localhost' (using password: YES) in /home//wp-includes/wp-db.php on line 1635
okay and what if nothing of this 3 fixes helps? sql server are the same as webserver (other programs has access) the username and passwords are right (used copy paste! and trible checked this) corrupted database? how the table WP_database is empty ! so now how to fix? the maria-db_error.log has no rejection request errors logged. :s
my site is hosted on AWS and i searched the mysql folder via filezila but couldn't find that file which contains database name and other credential. do you have any documentation for AWS or is there any specific name of that file ?
Thanks so much!!
Thank you very much for this video - very helpful. Got my site back up ^^ :D
I've started getting this error after upgrading my VPS (1 GB) plan to VPS (2 GB) plan. On VPS (1 GB), my website was getting around 500 users at the same time (working fine). But, after switching to VPS (2 GB), it could only handle 2 to 3 hundred users.
Any idea what the problem is?
thank you for the help
The testconnection.php only shows a blank page, nothing else... HELP!
Hi chaps, ..
I still haven't sorted out my localhost XAMPP issue, but a few things have poped up when trying out the above examples.
Firstly: PHP v5.5.0 scrapped, or depreciated the mysql_connect() function, and it seems that PHP 7 hasn't got the equivalent, .. I call that bullcrap.
After a lot of precious precocious digging: mainly coming off of the many precocious precious programmers out there, all humming and arring as they are wont do; then I've discovered that mysql (i) can be used instead. Note the [ i ] in the new function, and you can forget all that confusing blurb that goes on about PDO-functions, especially if all you want to do is test the bloomin' thing.
Also: the example shown in connecting to your database was -- $test Connection, -- when in fact it's $testConnection -- (no space.)
Here's the code, ..
Running it tells me that I can connect to my database, but I still can't get XAMPP to load my web-pages.
Note: not a *new* install, .. it was working fine last night, .. then it wasn't today.
My journey continues .. hope the above helps.
It still says error to establishing connection
for reference exactly what i did
___________________________Code Asked to put inside________________________
(note into php.config)
define ( 'WP_ALLOW_REPAIR', true );
after i put the code in i went to the website and did mywebsite/wp-admin/maint/repair.php
________________________________________Results_____________________________________
Same error word per word
Error establishing a database connection
__________________________Code i had at very start____________________________
(Note i did not erase any data only simply added what was told)
Liked & Subscribed. You really saved my ass dude. Thank You
Hola!!..When I tried to access the ftp file, I got this message:
Under Construction
The site you were trying to reach does not currently have a default page. It may be in the process of being upgraded.
Please help!!
theres no file called wp-config.php instead only wp-config-sample.php is available. where can i find it?
how can I fix it when i'm trying to get on the website through my phone and it shows the error?
How do you do this on a android phone?
After add new database I dont have any option like add a new user ..
The thing is I don't own the site and I don't have those wp-xxx.php files.
Awesome video
how to access wp-config.php file? I am not even able to login into admin. and FTP. it gave me an error "Unable to read the indexed puredb file (or old format detected) - Try pure-pw mkdb" not even to able login wp-admin. it showing the same error esablishing a database connection error to me. i am using goggie host provider hosting account they haven't given me any answer. can you help me .
i really dont know what my host is cause i dont know anything about this,but is this just for website owners btw i have the same problem
where can i find wp directory ?
Thanks Again
Thank you soo000000000000 much--Life saving