## Register Now

Thank you for registering with WPTricks

## How To Fix “Error Establishing A Database Connection” In WordPress

Learn how to fix “Error Establishing A Database Connection” on your WordPress blog!

Blog post:

1. can you tell how i can change the wordpress link like this /wp-content/uploads/2019/10/daniel-korpai-r73OFSry5AI-unsplash-tunespam-Chat.jpg

2. thank its great

3. 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.

4. Thanks, Sir! it really worked in my case

5. you kinda sound like emkay

6. I am indebted to you. I faced this issue in my website but that video helped me a lot in order to recover my website. Thumbs up and keep up the good work.

7. I liked your role in GOT. Say hello to John Snow from me.

8. thnks 🙂

9. Thank you so much! This happened to me today and I followed your instructions and all is good now! Again, thanks! Great video!

10. One more thing can cause this error that is updating PHP version in "cpanel" (may be in other hosting provider also). As I update version from 5.6 to 7.3 of PHP cause this error and updating takes time near about 15 minutes (may take upto 30 minutes depends on site).

11. Thanks Man. Best video 🙂

12. I am using localhost on my Mac. I tested php and MySQL and they are all working great. maint/repair didn't work, and all the data is correct.

13. Thank you Monsieur Firehose. (Thank god for slow down feature.) But seriously, very concise and to the point. I knew most of that, but good to have it all in one vid, especially for those who don't know.

14. Halp pls sir

15. 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, ..

<?php

$testConnection = mysqli_connect( 'localhost', 'root', 'password' ); if( !$testConnection ) {

die( 'Error: ' . mysql_error() );

}
echo 'Database Connection is working! ..';

mysqli_close (\$testConnection);

?>

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.

16. I Dont get it, I Got the error on Xbox one downloading minecraft mods, Its not my website Annnnnnddddddd i got no pc

17. Corrige seu USUÁRIO que você criou no Banco de dados do Mysql.
change your USER information you created in the Mysql Database.
ALTER USER ‘Usuario’@’localhost’ IDENTIFIED WITH mysql_native_password BY ‘SENHA-DO-USUÁRIO’;
SEGUE O LINK das informações no site do mysql.
https://dev.mysql.com/doc/refman/8.0/en/native-pluggable-authentication.html
https://dev.mysql.com/doc/refman/5.7/en/native-pluggable-authentication.html

18. http://relations-nations-unies.agence-presse.net
Error establishing a database connection

This either means that the username and password information in your wp-config.php file is incorrect or we can't contact the database server at ns322620.ip-37-187-155.eu. This could mean your host's database server is down.

Are you sure that you have typed the correct hostname?
Are you sure that the database server is running?

If you're unsure what these terms mean you should probably contact your host. If you still need help you can always visit the WordPress Support Forums.

19. thanks for your help it did work as you said

20. 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 .

21. I get this when I hit localhost/mywbsite before im even able to install my wp site.

22. Android pls

23. Bro same problem in Android
Please tell me how to solve it

24. Thank you 🙂

25. Error establishing a database connection The Chewy

26. Error establishing a database connection The Chewy

27. Error establishing a database connection The Chewy

28. Error establishing a database connection The Chewy

29. Hey thanks man!!
Wonderful video
I am really impressed to see that you have provided such an interesting information about WordPress.
I was struggling with the same issue since last 3 days and finally solved it. Anyways can you suggest me some better option to get cheap linux hosting other than redserverhost.com

30. Thanks a lot dear. Really Good video. You tell us a lot of information about this topic. I also write an article on this issue on my blog https://www.hamzagulzar.com