Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Generating MySQL 5.7 compatible (strong) password & discover old plaintext password?

Discussion in 'Database Discussion' started by postcd, Mar 24, 2019.

  1. postcd

    postcd Well-Known Member

    Joined:
    Oct 22, 2010
    Messages:
    700
    Likes Received:
    15
    Trophy Points:
    68
    Hello,

    on outdated My$QL 5.5.6 and old WHM

    i am wondering how (preferably via command line) i can
    1. discover plaintext password of the mysql users (except by manually finding their appropriate php file where password is)?
    2. generate strong password (compatible with the latest MySQL and with upcoming releases many years into future) and change MySQL password for the users

    (i already know generating & change can be done via GUI, though i prefer command line way and also do not know what "Strength"(used by outdated WHM) is required in order new MySQL 5.6+ accept the password and do not reset it once i migrate to new server)

    Thank you
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #1 postcd, Mar 24, 2019
    Last edited: Mar 24, 2019
  2. dalem

    dalem Well-Known Member PartnerNOC

    Joined:
    Oct 24, 2003
    Messages:
    2,883
    Likes Received:
    117
    Trophy Points:
    368
    Location:
    SLC
    cPanel Access Level:
    DataCenter Provider
    you could go to phpmyadmin as root mysql>myql.user it will be quite obvious which users are using plain text passwords

    you could also export the SELECT user,password FROM mysql.user; command to a file and sort it all the hashed passwords will have a *
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelLauren

    cPanelLauren Forums Analyst II Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    5,707
    Likes Received:
    436
    Trophy Points:
    233
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @postcd


    Something like the following might work to get you the old password style users:

    Code:
    [root@server ~]# mysql
    MariaDB [(none)]> use mysql
    MariaDB [mysql]> select user,password from user where length(password) < 41;
    MySQL passwords are not stored in plaintext and really you shouldn't even need to know them in order to change them.

    You could then use the UAPI for those users to set their password:

    UAPI Functions - Mysql::set_password - Developer Documentation - cPanel Documentation

    This won't let you set a password that doesn't meet the minimum strength requirements for MySQL
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice