Home > Database > Mysql Tutorial > body text

MySQL管理之用户权限

WBOY
Release: 2016-06-07 17:26:33
Original
1159 people have browsed it

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都是读权限,一般可以赋予,,其他权限则都为写权限需要慎重考虑授权




本文出自 “心情依旧” 博客,请务必保留此出处

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!