MariaDB、MySQLでユーザー一覧を確認する

2021-06-28

MariaDB、MySQLで設定しているユーザーを確認するコマンドです。MySQLとMariaDBとも共通で「select Host, User, Password from mysql.user;」で確認ができます。

MariaDB [(none)]> select Host, User, Password from mysql.user;
+-----------+----------------+-------------------------------------------+
| Host      | User           | Password                                  |
+-----------+----------------+-------------------------------------------+
| localhost | root           | *A115B578EXXXXXXXXXXX2A9640B6XXXXXXXXXXXX |
| 127.0.0.1 | root           | *A115B578EXXXXXXXXXXX2A9640B6XXXXXXXXXXXX |
+-----------+----------------+-------------------------------------------+
7 rows in set (0.00 sec)