10 Aug
2018
10 Aug
'18
8:56 p.m.
Hi, Felipe! On Aug 10, Felipe Gasper wrote:
Hi all,
What is the best way to fetch a user’s password hash? I’d ideally like something that works in both MySQL and MariaDB, as many versions as possible.
Thank you!
You can select from mysql.user. You can use IF() function to create a select that returns a password no matter what column it's in. It'd be the most universal way, I think. There're also SHOW GRANTS and SHOW CREATE USER, but they output is version dependent and might have weird privilege requirements to see the password. Regards, Sergei Chief Architect MariaDB and security@mariadb.org