Reputation: 9092
I use mySQL on Mac OS. I login mySQL by the command
mysql - u root
then run the command below
select User from mysql.user;
It show the table below
+---------+
| User |
+---------+
| root |
| root |
| |
| root |
| |
| gerrit2 |
| root |
+---------+
7 rows in set (0.08 sec)
I don't understand that there're 4 rows has root and 2 rows has no name. Please explain me. Thank you!
Upvotes: 5
Views: 4854
Reputation: 65332
The row-defining part in mysql.users is the (host,user) tuple - this means:
Upvotes: 4
Reputation: 26739
You can have multiple records for the same user in the mysql.user table, since you can have different passwords and/or permissions depending on the host the user connects from. If you run select * you will see the differences.
Upvotes: 2