2

I have a MySQL pair that communicates over a VIP. I want to verify permissions for all users (including root) from ANY IP. When I attempt to view all grants for root I get this:

mysql> show grants for root;
ERROR 1141 (42000): There is no such grant defined for user 'root' on host '%'

But there are other grants for root:

mysql> show grants for 'root'@'localhost';
+----------------------------------------------------------------------------------------------------------------------------------------+
| Grants for root@localhost                                                                                                              |
+----------------------------------------------------------------------------------------------------------------------------------------+
| GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION |
| GRANT ALL PRIVILEGES ON `*.*`.* TO 'root'@'localhost'                                                                                  |
| GRANT PROXY ON ''@'' TO 'root'@'localhost' WITH GRANT OPTION                                                                           |
+----------------------------------------------------------------------------------------------------------------------------------------+
3 rows in set (0.00 sec)

How can I view ALL grants for a user (all hosts and databases)?

Ken J
  • 4,312
  • 12
  • 50
  • 86

1 Answers1

12

You can use this:

select * from INFORMATION_SCHEMA.SCHEMA_PRIVILEGES;
DecoderReloaded
  • 514
  • 4
  • 12