Monday, July 29, 2013

List Users, Hosts on MySQL

First, start a MySQL session from (for example) xterm:
$ mysql -u root -p

After entering your credentials, you should see this (output is blue):
mysql> 

Now, run the following command (in bold):
mysql> SELECT User,Host FROM mysql.user;

+------+--------------+
| User | Host         |
+------+--------------+
| aco  | %            |
| root | %            |
| root | 127.0.0.1    |
| aco  | 192.168.1.40 |
| aco  | localhost    |
| root | localhost    |
+------+--------------+
6 rows in set (0.00 sec)

No comments:

Post a Comment