您好,欢迎访问一九零五行业门户网

MySQL管理之用户权限

mysql用户管理mysql授权级别·全局级别·数据库级别(能否删除创建库·表级别·字段级别·储存过程、存储函数级别需要了解的三种权限类型·管理类·数据库访问类
|
+------------------------------------------------------------------------------------------------------+
| grant usage on *.* to 'test1'@'%' identified by password'*6bb4837eb74329105ee4568dda7dc67ed2ca2ad9'  |
| grant create on `wpdb`.* to'test1'@'%'                                                               |
| grant create on `abc`.* to'test1'@'%'                                                                |
| grant select, insert, create on `test1`.* to'test1'@'%'                                              |
| grant create on `mysql`.`wpdb` to 'test1'@'%'                                                        |
+------------------------------------------------------------------------------------------------------+
5 rows in set (0.00 sec)
|
| grant create on `abc`.* to'test1'@'%'                                                                |
| grant select, insert, create, alter on `test1`.* to'test1'@'%'                                       |
| grant update (age) on `test1`.`testtb` to'test1'@'%'                                                 |
| grant create on `mysql`.`wpdb` to'test1'@'%'                                                         |  
+------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)
mysql> showgrants for test1@'%';
+------------------------------------------------------------------------------------------------------+
| grants for test1@%                                                                                  |
+------------------------------------------------------------------------------------------------------+
| grant usage on *.* to 'test1'@'%' identified by password '*6bb4837eb74329105ee4568dda7dc67ed2ca2ad9' |
| grant create on `wpdb`.* to'test1'@'%'                                                               |
| grant create on `abc`.* to 'test1'@'%'                                                               |
| grant insert, create, alter on `test1`.* to 'test1'@'%'                                              |
| grant update (age) on `test1`.`testtb` to'test1'@'%'                                                 |
| grant create on `mysql`.`wpdb` to'test1'@'%'                                                         |
+------------------------------------------------------------------------------------------------------+
6 rows in set (0.00 sec)
一般来讲select都是读权限,一般可以赋予,,其他权限则都为写权限需要慎重考虑授权
本文出自 “心情依旧” 博客,请务必保留此出处
其它类似信息

推荐信息