dev-sec / mysql-baseline

DevSec MySQL Baseline - InSpec Profile

Home Page:https://dev-sec.io/baselines/mysql/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mysql 5.7.6 password -> authentication_string

rndmh3ro opened this issue · comments

In mysql 5.7.6 and onwards, the mysql.user table does not have a password column anymore. It's a authentication_string:

kitchen@5af1356b9fdf:~$ mysql -uroot -piloverandompasswordsbutthiswilldo mysql -s -e 'select user,host,password from mysql.user ;'
ERROR 1054 (42S22) at line 1: Unknown column 'password' in 'field list'

kitchen@5af1356b9fdf:~$ mysql -uroot -piloverandompasswordsbutthiswilldo mysql -s -e 'select user,host,authentication_string from mysql.user ;'
user	host	authentication_string
root	localhost	*0B99593EA05A61BB7D37562CA767CB36FE954CE8
Server version: 5.7.17-0ubuntu0.16.04.2 (Ubuntu)

See: https://dev.mysql.com/doc/refman/5.7/en/grant-tables.html

In MySQL 5.7.6, the Password column was removed and all credentials are stored in the authentication_string column.

This is actually somewhat more complicated since MariaDB continues to use the password-column by default. But if one is using pam-authentication the authentication_string column will be used.

See here: https://dba.stackexchange.com/a/209973