Fix “Error Establishing a Database Connection”

How to Fix the Error Establishing a Database Connection :
If you have been surfing the web for a while, you have at least seen this error a few times.
Error Establishing a Database Connection is one of those curses that could be caused by many reasons.
As a WordPress beginner, this could be awfully frustrating specially when it happened on its own without you changing anything.
Note: Before you make any database changes, make sure you have backup of your database file and WP-config.PHP file.
Please follow the below steps :
1 Log in to cPanel
2 Go to the WordPress directory and then click on WP-config.php.
3 As I mentioned, WordPress uses a specific username and password to connect to the database which looks like :
define(‘DB_NAME’, ‘some_db’);
define(‘DB_USER’, ‘some_username’);
define(‘DB_PASSWORD’, ‘some_pass’);
define(‘DB_HOST’, ‘localhost’);
4 Make sure username and password must match with the credentials you created in MySQL Database in cPanel.
Once the username and password will same in wp-config.php script and MySQL Database section in cpanel Error will resolve.
Some More Solutions easy one to check if still you face the issue ;
1 Go to MySQL database Option in Cpanel and then choose the database and click on Repair Database.
2 You can also rename the plugin and theme folder if the issue continues.
3 Final Solution download the wp-config.php from the WordPress site which is mentioned below and update the username password and database name .
Download WordPress default files :
Thanks for watching this video
Please like and subscribe for more videos
Nguồn: https://mygoguryeo.net
Xem thêm bài viết khác: https://mygoguryeo.net/cong-nghe/
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
best services
nice video..but i want to know can it come all of a sudden automatically with the site going on fine and i did not change anything??
hi
pls help me with that