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
-
Log in to cPanel.
-
In the right sidebar, under General Information, click Server Information.
-
Locate the MySQL Version row.
Step 2: Delete and Recreate the User
-
Log in to cPanel.
-
Go to Databases → Manage My Databases (or MySQL Databases in older versions).
-
Under Current Users, locate the affected user → click Delete.
-
Confirm deletion.
-
Under Add New User, re‑create the same username.
-
Enter the password:
-
You can reuse the old password (check your application’s config file, e.g.,
wp-config.phpfor WordPress). -
Or generate a new strong password using Password Generator.
-
-
Click Create User.
-
Re‑assign the user to the database with ALL PRIVILEGES.
Notes
|