Phpmyadmin asking for username and password when login through user cPanel.

l2Support

Member
PartnerNOC
Dec 15, 2006
21
1
153
Suddenly, phpmyadmin asking username and password when login through user cPanel.
It is working fine while login through WHM root.

Version: WHM 54.0 (build 8) PHP 5.5.30 MYSQL 5.6.28,

Is there any solution on it?
 

kjg

Well-Known Member
Mar 2, 2004
160
3
168
Hi
We have had this issue a number of times and the reason has been password problems.
Changing the cpanel password (and that way also mysql password) have solved it for us each time.

Hope this helps.
 

l2Support

Member
PartnerNOC
Dec 15, 2006
21
1
153
Thanks.. unfortunately that is not helping.. following is the error from cpanel error logs :
Code:
[2016-02-03 15:02:20 +0530] warn [cpmysql] Error from MySQL query: (XID q9p6tf) DBD::mysql::db do failed: The password hash doesn't have the expected format. Check if the correct password algorithm is being used with the PASSWORD() function. at /usr/local/cpanel/Cpanel/Mysql.pm line 1533.

Cpanel::Mysql::_dbowner_to_all_with_ownership_checks(Cpanel::Mysql=HASH(0x1943d18), "method", "GRANT", "users", HASH(0x14f69a8)) called at /usr/local/cpanel/Cpanel/Mysql.pm line 761
Cpanel::Mysql::updateprivs(Cpanel::Mysql=HASH(0x1943d18)) called at bin/admin/Cpanel/cpmysql.pl line 181
 
Last edited by a moderator:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Hello :)

Check to see if the "mysql_old_format" plugin is configured for this user with a command such as:

Code:
mysql -e 'select user, length(Password), plugin from mysql.user WHERE user="$username";'
If so, you can update this with commands such as:

Code:
mysql
mysql > use mysql; 
mysql> update user set Plugin = 'mysql_native_password' where Plugin = 'mysql_old_password';
Then, change the password of the account again, and let us know if the issue persists after clearing your browser cache.

Thank you.
 

l2Support

Member
PartnerNOC
Dec 15, 2006
21
1
153
Hello :)

Check to see if the "mysql_old_format" plugin is configured for this user with a command such as:

Code:
mysql -e 'select user, length(Password), plugin from mysql.user WHERE user="$username";'
If so, you can update this with commands such as:

Code:
mysql> update user set Plugin = 'mysql_native_password' where Plugin = 'mysql_old_password';
Then, change the password of the account again, and let us know if the issue persists after clearing your browser cache.

Thank you.


Thanks a lot !! :) that worked !! cheerz.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
I am happy to see it helped. Thank you for updating us with the outcome.
 

em.ci

Well-Known Member
Jun 15, 2015
52
2
8
Switzerland
cPanel Access Level
Root Administrator
Hello :)

Check to see if the "mysql_old_format" plugin is configured for this user with a command such as:

Code:
mysql -e 'select user, length(Password), plugin from mysql.user WHERE user="$username";'
If so, you can update this with commands such as:

Code:
mysql> update user set Plugin = 'mysql_native_password' where Plugin = 'mysql_old_password';
Then, change the password of the account again, and let us know if the issue persists after clearing your browser cache.

Thank you.
Hi Michael

If I try to update the cpanel user with this command i recieve the error:

ERROR 1046 (3D000): No database selected

Any ideas what could be the problem?

Thanks,
emci
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Any ideas what could be the problem?
Code:
mysql
mysql > use mysql;
mysql > update user set Plugin = 'mysql_native_password' where Plugin = 'mysql_old_password';
I've updated the commands to show how to use the "mysql" database.

Thank you.
 

em.ci

Well-Known Member
Jun 15, 2015
52
2
8
Switzerland
cPanel Access Level
Root Administrator
Code:
mysql
mysql > use mysql;
mysql > update user set Plugin = 'mysql_native_password' where Plugin = 'mysql_old_password';
I've updated the commands to show how to use the "mysql" database.

Thank you.
Hi Michael,

Thanks for the Update. So am I right that this command updates every mysql user with the old password hash on the server?

Thanks,
emci
 

em.ci

Well-Known Member
Jun 15, 2015
52
2
8
Switzerland
cPanel Access Level
Root Administrator
I have still a problem with the database users. When I try to change the user password I receive the following error:

Code:
(XID qdku4t) DBD::mysql::db do failed: Password hash should be a 16-digit hexadecimal number
I checked the user with the following command:
Code:
mysql -e 'select user, length(Password), plugin from mysql.user WHERE user="user1_db";'
Then I received the following output:


Code:
+----------+------------------+--------------------+
| user     | length(Password) | plugin             |
+----------+------------------+--------------------+
| user1_db |               16 | mysql_old_password |
| user1_db |               16 | mysql_old_password |
| user1_db |               16 | mysql_old_password |
+----------+------------------+--------------------+
Then I used the following command to change the plugin format:

Code:
mysql
mysql > use mysql;
mysql > update user set Plugin = 'mysql_native_password' where Plugin = 'mysql_old_password';
Now the output looks like this:

Code:
+-----------+------------------+-----------------------+
| user      | length(Password) | plugin                |
+-----------+------------------+-----------------------+
| user1_db |               16 | mysql_native_password |
| user1_db |               16 | mysql_native_password |
| user1_db |               16 | mysql_native_password |
+-----------+------------------+-----------------------+
But I still get the same error message. So is there any way to change the "lenght(Password) from 16 to 41?

Thanks,
emci
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
But I still get the same error message. So is there any way to change the "lenght(Password) from 16 to 41?
Hello,

Did you change the password for the user after updating the plugin format?

Thank you.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,227
463
Yes I changed the password and I received the same error message. But now it is working. I had to restart mysql first and then change the password.
I'm happy to see the issue is now resolved. Thank you for updating us with the outcome.
 
  • Like
Reactions: em.ci