Knowledge Base
MilesWeb / MySQL

How to Resolve “MySQL passwords do not work after upgrade” Error?

Approx. read time : 2 min

In this article, you will learn to resolve the problem that occurs after a server is upgraded to MySQL 5.6.5 or later.

In case you don’t know which MySQL version is installed on your server, follow these steps:

  1. Log in to cPanel.
  2. Go to the right sidebar of the cPanel home screen, under General Information, click Server Information.
  3. Under Server Information, locate the MySQL Version row to check the MySQL version installed on the server.

Problem

When accessing a database on the server running MySQL 5.6.5 or later, the login fails even if you have been using the correct username and password.

For instance, while running WordPress on your site, you see the below error message:

Error establishing a database connection

Also with other web applications, similar messages may get displayed about database connection errors.

Cause

The cause of this issue is the use of a new hashtag method for user passwords by MySQL 5.6.5. The further MySQL versions don’t support the hash method, used in older versions of MySQL to store passwords and so the logins fail.

Resolution

For resolving this issue, you should delete and recreate the database user. While doing this, the new hash method is used by MySQL to store the password, and the database user can log in again.

To do this, follow the below steps:

  1. Log in to your cPanel account.
  2. Go to the Databases section of the cPanel home screen and click on MySQL® Databases.
  3. Then locate the database user that you want to recreate under Current Users and click Delete.
  4. In order to confirm the deletion, click Delete User and then click on Go Back.
  5. Under Add New User, in the Username text box, type the username of the user you deleted just now.
  6. In the Password text box, type the user password.
    Note: There is no need to create a new password for the user. The previous password can be used, if you want to keep the password unchanged. For finding the current password, check your application’s configuration files. For example, for WordPress, you will need to check the wp-config.php file for database configuration information.
  7. Retype the user password in the Password (Again) text box.
    Note: As an alternative, you can click Password Generator and cPanel will generate a random, strong password for you.
  8. Now click on Create User. cPanel creates the database user with the new hashing method to store the password.

In this way, you can resolve the error “Error establishing a database connection”.

Pallavi is a Digital Marketing Executive at MilesWeb and has an experience of over 4 years in content development. She is interested in writing engaging content on business, technology, web hosting and other topics related to information technology.

Trusted By Thousands of Clients & Big Businesses

We highly appreciate the kind and stellar feedback we receive from our customers. Delivering the best is our goal! MilesWeb is rated Excellent out of 5 based on reviews. Read more reviews.

Excellent
Based on reviews
2 hours ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
4 hours ago
Milesweb is superb Hosting pro...
Milesweb is superb Hosting provider ever, their Support team is amazing!!!...
Abhishek Singh
15 hours ago
Great support in great timing...
We need urgent assistance on changes in a primary domain on our client's Cpanel accounts and reached...
Riyaju Deen
21 hours ago
Best Website Hosting platform ...
I was new on MilesWeb. And needed help on multiple areas from setting up to getting started with cre...
Harshada
1 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
1 days ago
the team is very supportive th...
the team is very supportive though at times effort needs to be made to make understand the problem s...
Suree Sharma
1 days ago
I am using miles web for 3plus...
I am using miles web for 3plus years, very quick and perfect support by the team, they helped me man...
Sri Raghav
2 days ago
The service is good...
The service is good. They are answering with patience and doing the needful as soon as possible....
MR
2 days ago
Perfect and Valuable Server + ...
I am using MilesWeb Servers, The main thing which I getting are continuous support over everything w...
Gunjan Makwana
3 days ago
Very quick and helpful assista...
Very quick and helpful assistance. Support person listened properly and provided a nice solution....
Narendra
4 days ago
positively helped me with find...
positively helped me with finding insecure content on my website causing SSL to not work properly on...
Thaviraj Junglee
4 days ago
Exceptional support, Truly Pra...
I had opted for the basic wordpress hosting plan as I intended to experiment with various plug-ins. ...
Aseem Chandna