GMgKe586q6suSQnyqZLlGCooeWM

Pages

Search

Thursday, December 23, 2010

MySQL Giving Privileges To User

Give all privileges to 'luna'@'localhost':
mysql> GRANT ALL PRIVILEGES ON *.* TO 'luna'@'localhost' 
       WITH GRANTS OPTION;
Query OK, 0 rows affected (0.00 sec)

To show what the grant of a specified user, please type:
mysql> SHOW GRANTS FOR 'luna'@'localhost';
+------------------------------------------+
| Grants for luna@localhost                |
+------------------------------------------+
| GRANT USAGE ON *.* TO 'luna'@'localhost' |
+------------------------------------------+
1 row in set (0.00 sec)

To give some grants, please type:
mysql> GRANTS SELECT, UPDATE, INSERT, DELETE, CREATE, DROP ON
       bankAccount.* TO 'luna'@'localhost';
Query OK, 0 rows affected (0.01 sec)

To give some grants for a table, type:
mysql> GRANTS SELECT, UPDATE, INSERT, DELETE, CREATE, DROP ON
       customer.data TO 'luna'@'localhost';
Query OK, 0 rows affected (0.01 sec)
               


Share/Bookmark

No comments:

Post a Comment