Monday, September 28, 2015

How to view a list of MySQL users and their privileges




mysql> select user,host from mysql.user;

+------------------+--------------+
| user             | host                 |
+------------------+--------------+
| root             | %                    |
| root             | 127.0.0.1         |
| honnikery   | localhost     |
| dba             | %                     |
| test              | localhost           |
+------------------+--------------+


5 rows in set (0.01 sec)


mysql> show grants for 'root'@'%';

+------------------------------------------------+
| Grants for root@%                              |
+------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' .... |
+------------------------------------------------+
1 row in set (0.00 sec)

No comments:

Post a Comment