I just read setup directions on a different site that says I should make a copy of wp-sample-config.php, rename it wp-config.php, add the database, user, etc, to the file, then FTP it into the www folder where my WP files are located.
I did that, reloaded the web page wherein I setup WP (one step down from root), and now I don’t even get the WP intro interface. It goes straight to the error message…Error establishing a database connection.
So I removed wp-config.php from the www folder, and it’s back to the WP intro interface, but I’m still getting the same error message when I try to setup-config, same as before.
Hello,
Try resetting your MySQL password manually.
You can find it, here: https://codex.ww.wp.xz.cn/Installing_WordPress#Common_Installation_Problems
Hope this helps.
Regards,
Thanks. I changed the password in my cpanel and it worked.
I’m not sure why this could happen, though, because I switched the old password with the exact same password. Odd…
I used to work for a hosting company, and I would see this error a lot, other times it can be caused by lack of optimization of your site, as well as heavy loads of traffic, that your host cannot keep up with on your plan.
Here you may need to create separate database user with strong password instead of using cpanel user name and password. Might be this will get chance to hacker to hack the website.
Everything about website credential like database name, user name and password etc present on config file – https://codex.ww.wp.xz.cn/Editing_wp-config.php
-
This reply was modified 9 years, 7 months ago by
Anil Jadhav.
Thank you. The password was the problem.
Just Verify that your’re entering right credentials,
i.e
1. Database username: XYZ (you can find it in your Cpanel)
2. Database user Password: XYZ_user (also in cpanel, when you created database you have to create user for database and enter a password and click on create after that you need to click on all privileges for user access)
and thats it.
now you can do it manually go to the wp root and find wp-config.php file and enter the follwing fields
/** The name of the database for WordPress */
define( ‘DB_NAME’, ‘XYZ’ );
/** MySQL database username */
define( ‘DB_USER’, ‘XYZ_user’ );
/** MySQL database password */
define( ‘DB_PASSWORD’, ‘password_mentioned’ );
/** MySQL hostname */
define( ‘DB_HOST’, ‘localhost’ );
That’s it hope if you follow these instruction you will never face any issue.
Tip: in similar situations, use wp config, set the DEBUG to true in order to see something beyond wsod (white screen of death)
Good luck