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

postcd

Well-Known Member
Oct 22, 2010
717
19
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
 
Last edited:

dalem

Well-Known Member
PartnerNOC
Oct 24, 2003
2,976
152
368
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 *
 

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,252
313
Houston
Hi @postcd


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

Code:
[[email protected] ~]# 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