Hi,
How to view a list of MySQL users and their privileges? It want to view these two information in just one query.
Thanks
Hi,
Today I will teach you sql command to view list of users and their privileges in MySQL database.
If you have many users and databases on production server then you can easily view list of all the users and their privileges. This command is very helpful to see users on a production environment where multiple users are created for different databases.
Here is the command:
select user,host from mysql.user;
This command gives following output:
mysql> select user,host from mysql.user; +------------+-----------+ | user | host | +------------+-----------+ | webservice | % | | root | 127.0.0.1 | | root | ::1 | | root | localhost | | webservice | localhost | +------------+-----------+ 5 rows in set (0.00 sec) mysql>
Thanks
Ads