在MySQL數據庫中,默認的用戶表是mysql.user
。這個表記錄了MySQL中的所有用戶和他們的權限。
mysql> SELECT User, Host, authentication_string FROM mysql.user;
+------------------+-----------+-------------------------------------------+
| User | Host | authentication_string |
+------------------+-----------+-------------------------------------------+
| root | localhost | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| root | ::1 | *81F5E21E35407D884A6CD4A731AEBFB6AF209E1B |
| mysql.sys | localhost | *THISISNOTAVALIDPASSWORDTHATCANBEUSEDHERE |
| debian-sys-maint | localhost | *BEE8432D806E86F802F564B9B0B083EB8D7FEFEC |
+------------------+-----------+-------------------------------------------+
4 rows in set (0.00 sec)
可以通過這個表來創建、刪除和更改用戶的權限。