Home > Software engineering >  Wordpress - problem establishing a database connection, Access denied for user
Wordpress - problem establishing a database connection, Access denied for user

Time:12-09

This is a wordpress question. I have an error "Error establishing a database connection". Access denied for user. (using password: YES).

Through CPanel I changed the password for the user under the "Current Users". Let's say that in my wp-config.php file there was:

/** The name of the database for WordPress */
define( 'DB_NAME', 'coded_wp782' );

/** MySQL database username */
define( 'DB_USER', 'coded_wp782' );

/** MySQL database password */
define( 'DB_PASSWORD', 'flke7djefd' );

When I changed the password for the user coded_wp782 through CPanel, the DB_PASSWORD in the above wp-config.php did not change but remained flke7djefd. I guess that flke7djefd is a coded version of what I put in through CPanel. How can I solve this? Should I put the uncoded password directly in the wp-config.php file? - I do not feel comfortable doing that. I also tried creating a new user and adding it to the database but it did not work, and the wp-config.php file did not change.

CodePudding user response:

You can do create another database user from cpanel and can assign to respective database. Also, make sure to update config file accordingly once you done with the privileges granting.

CodePudding user response:

Did you selected MD5 function on user_pass when changing the password in the database?

  • Related