The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

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

Discussion in 'Database Discussions' started by l2Support, Feb 4, 2016.

  1. l2Support

    l2Support Member

    Joined:
    Dec 15, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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?
     
  2. kjg

    kjg Well-Known Member

    Joined:
    Mar 2, 2004
    Messages:
    147
    Likes Received:
    0
    Trophy Points:
    16
    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.
     
  3. l2Support

    l2Support Member

    Joined:
    Dec 15, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1
    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
    
     
    #3 l2Support, Feb 4, 2016
    Last edited by a moderator: Feb 4, 2016
  4. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    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
    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.
     
  5. l2Support

    l2Support Member

    Joined:
    Dec 15, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    1


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

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  7. em.ci

    em.ci Active Member

    Joined:
    Jun 15, 2015
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Switzerland
    cPanel Access Level:
    Root Administrator
    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
     
  8. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    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.
     
  9. em.ci

    em.ci Active Member

    Joined:
    Jun 15, 2015
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Switzerland
    cPanel Access Level:
    Root Administrator
    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
     
  10. em.ci

    em.ci Active Member

    Joined:
    Jun 15, 2015
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    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
     
  11. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thank you.
     
  12. em.ci

    em.ci Active Member

    Joined:
    Jun 15, 2015
    Messages:
    40
    Likes Received:
    0
    Trophy Points:
    6
    Location:
    Switzerland
    cPanel Access Level:
    Root Administrator
    Hi Michael,

    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.
     
  13. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,678
    Likes Received:
    648
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    I'm happy to see the issue is now resolved. Thank you for updating us with the outcome.
     
Loading...

Share This Page