After upgrading to MySQL 5.6.5 or later, you may find that existing database passwords no longer work, even though you are entering the correct credentials. This is due to changes in MySQL’s password hashing method.

 

Problem

  • When accessing a database, login fails with errors like:

    Error establishing a database connection
    
  • Applications such as WordPress or other CMSs may stop connecting to the database.

 

Cause

  • MySQL 5.6.5 and newer versions use a new hashing method for storing user passwords.

  • Older password hashes are no longer supported, so logins fail after the upgrade.

 

Resolution

Step 1: Confirm MySQL Version

  1. Log in to cPanel.

  2. In the right sidebar, under General Information, click Server Information.

  3. Locate the MySQL Version row.

 

Step 2: Delete and Recreate the User

  1. Log in to cPanel.

  2. Go to Databases → Manage My Databases (or MySQL Databases in older versions).

  3. Under Current Users, locate the affected user → click Delete.

  4. Confirm deletion.

  5. Under Add New User, re‑create the same username.

  6. Enter the password:

    • You can reuse the old password (check your application’s config file, e.g., wp-config.php for WordPress).

    • Or generate a new strong password using Password Generator.

  7. Click Create User.

  8. Re‑assign the user to the database with ALL PRIVILEGES.

Notes

  • Recreating the user forces MySQL to store the password using the new hash method.

  • You do not need to change the password in your application if you reuse the same one.

  • Always back up your database before making user changes.

 
Hjälpte svaret dig? 0 användare blev hjälpta av detta svar (0 Antal röster)

Powered by WHMCompleteSolution