Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
-
Economics & Finance
Selected Reading
Does grant on *.* apply to databases created after the grant in MySQL?
Yes, since this is a global privilege. Let us first create a user −
mysql> CREATE USER 'Jace'@'localhost' IDENTIFIED BY 'Jace123'; Query OK, 0 rows affected (0.67 sec)
Here is the query to grant for global privileges with *.*:
mysql> GRANT SELECT ON *.* TO 'Jace'@'localhost'; Query OK, 0 rows affected (0.58 sec)
Now you can show all grants for a user −
mysql> show grants for 'Jace'@'localhost';
This will produce the following output −
+-------------------------------------------+ | Grants for Jace@localhost | +-------------------------------------------+ | GRANT SELECT ON *.* TO `Jace`@`localhost` | +-------------------------------------------+ 1 row in set (0.14 sec)
Advertisements
