tags:

views:

510

answers:

3

Version 5.4.1

Am using command line utility and can navigate through database but now need to see the list of user accounts.

Cheers

+3  A: 

Use this query:

SELECT User FROM mysql.user;

Which will output a table like this:

+-------+
| User  |
+-------+
| root  |
+-------+
| user2 |
+-------+
gclaghorn
I think it may be necessary to group on `User` too, to only get unique user values, since there's a seperate row for each `user`@`host` entry.
Matthew Scharley
+2  A: 

If you are referring to the actual MySQL users, try:

select User from mysql.user;
Jesse
A: 
SELECT * FROM mysql.user;

It's a big table so you might want to be more selective on what fields you choose.

Peter Spain