Access denied for user Print

  • database, password, cpanel, troubleshooting, errors, webhosting, guide, howto
  • 0

The database refused the credentials.

WHAT IT MEANS

The username or password is wrong, or the user is not permitted to access that database.

THE CHECKS

Is the username correct, including the cPanel prefix Is the password correct Is the user assigned to that database Does the user have privileges

FIXING IT

cPanel > MySQL Databases. Find the user under Current Users.

If it is not listed under the database in question, add it with ALL PRIVILEGES.

If the password is uncertain, change it there and update the application configuration to match.

THE HOST PART

The error frequently shows user@localhost. That is correct for shared hosting.

If it shows a different host, the configuration is pointing somewhere wrong. DB_HOST should be localhost.

AFTER CHANGING A CPANEL PASSWORD

Some operations reset associated database passwords. If the site failed immediately after a password change, this is why.

Reset the database user password and update the configuration.

THE RELIABLE FIX

Create a fresh user, assign it, and update the configuration. Faster than diagnosing.


Was this answer helpful?
Back

Are you happy with your experience? Leave us a review on Trustpilot.


Trustpilot