mysql 用户权限管理详细
grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。
grant select on testdb.* to common_user@’%’
grant insert on testdb.* to common_user@’%’
grant update on testdb.* to common_user@’%’
grant delete on testdb.* to common_user@’%’
或者,用一条 MySQL 命令来替代:
grant select, insert, update, delete on testdb.* to common_user@’%’
9>.grant 数据库开发人员,创建表、索引、视图、存储过程、函数。。。等权限。
grant 创建、修改、删除 MySQL 数据表结构权限。
grant create on testdb.* to developer@’192.168.0.%’;
grant alter on testdb.* to developer@’192.168.0.%’;
grant drop on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 外键权限。
grant references on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 临时表权限。
grant create temporary tables on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 索引权限。
grant index on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 视图、查看视图源代码 权限。
grant create view on testdb.* to developer@’192.168.0.%’;
grant show view on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 存储过程、函数 权限。
grant create routine on testdb.* to developer@’192.168.0.%’; -- now, can show procedure status
grant alter routine on testdb.* to developer@’192.168.0.%’; -- now, you can drop a procedure
grant execute on testdb.* to developer@’192.168.0.%’;
10>.grant 普通 DBA 管理某个 MySQL 数据库的权限。
grant all privileges on testdb to dba@’localhost’
其中,关键字 “privileges” 可以省略。
11>.grant 高级 DBA 管理 MySQL 中所有数据库的权限。
grant all on *.* to dba@’localhost’
12>.MySQL grant 权限,分别可以作用在多个层次上。
1. grant 作用在整个 MySQL 服务器上:
grant select on *.* to dba@localhost; -- dba 可以查询 MySQL 中所有数据库中的表。
grant all on *.* to dba@localhost; -- dba 可以管理 MySQL 中的所有数据库
2. grant 作用在单个数据库上:
grant select on testdb.* to dba@localhost; -- dba 可以查询 testdb 中的表。
3. grant 作用在单个数据表上:
grant select, insert, update, delete on testdb.orders to dba@localhost;
4. grant 作用在表中的列上:
grant select(id, se, rank) on testdb.apache_log to dba@localhost;
5. grant 作用在存储过程、函数上:
grant execute on procedure testdb.pr_add to ’dba’@’localhost’
grant execute on function testdb.fn_add to ’dba’@’localhost’
注意:修改完权限以后 一定要刷新服务,或者重启服务,刷新服务用:FLUSH PRIVILEGES。
| 权限 | 说明 |
| all | |
| alter | |
| alter routine | 使用alter procedure 和drop procedure |
| create | |
| create routine | 使用create procedure |
| create temporary tables | 使用create temporary table |
| create user | |
| create view | |
| delete | |
| drop | |
| execute | 使用call和存储过程 |
| file | 使用select into outfile 和load data infile |
| grant option | 可以使用grant和revoke |
| index | 可以使用create index 和drop index |
| insert | |
| lock tables | 锁表 |
| process | 使用show full processlist |
| reload | 使用flush |
| replication client | 服务器位置访问 |
| replocation slave | 由复制从属使用 |
| select | |
| show databases | |
| show view |
| shutdown | 使用mysqladmin shutdown 来关闭mysql |
| super | |
| update | |
| usage | 无访问权限 |
grant 普通数据用户,查询、插入、更新、删除 数据库中所有表数据的权利。
grant select on testdb.* to common_user@’%’
grant insert on testdb.* to common_user@’%’
grant update on testdb.* to common_user@’%’
grant delete on testdb.* to common_user@’%’
或者,用一条 MySQL 命令来替代:
grant select, insert, update, delete on testdb.* to common_user@’%’
9>.grant 数据库开发人员,创建表、索引、视图、存储过程、函数。。。等权限。
grant 创建、修改、删除 MySQL 数据表结构权限。
grant create on testdb.* to developer@’192.168.0.%’;
grant alter on testdb.* to developer@’192.168.0.%’;
grant drop on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 外键权限。
grant references on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 临时表权限。
grant create temporary tables on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 索引权限。
grant index on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 视图、查看视图源代码 权限。
grant create view on testdb.* to developer@’192.168.0.%’;
grant show view on testdb.* to developer@’192.168.0.%’;
grant 操作 MySQL 存储过程、函数 权限。
grant create routine on testdb.* to developer@’192.168.0.%’; -- now, can show procedure status
grant alter routine on testdb.* to developer@’192.168.0.%’; -- now, you can drop a procedure
grant execute on testdb.* to developer@’192.168.0.%’;
10>.grant 普通 DBA 管理某个 MySQL 数据库的权限。
grant all privileges on testdb to dba@’localhost’
其中,关键字 “privileges” 可以省略。
11>.grant 高级 DBA 管理 MySQL 中所有数据库的权限。
grant all on *.* to dba@’localhost’
12>.MySQL grant 权限,分别可以作用在多个层次上。
1. grant 作用在整个 MySQL 服务器上:
grant select on *.* to dba@localhost; -- dba 可以查询 MySQL 中所有数据库中的表。
grant all on *.* to dba@localhost; -- dba 可以管理 MySQL 中的所有数据库
2. grant 作用在单个数据库上:
grant select on testdb.* to dba@localhost; -- dba 可以查询 testdb 中的表。
3. grant 作用在单个数据表上:
grant select, insert, update, delete on testdb.orders to dba@localhost;
4. grant 作用在表中的列上:
grant select(id, se, rank) on testdb.apache_log to dba@localhost;
5. grant 作用在存储过程、函数上:
grant execute on procedure testdb.pr_add to ’dba’@’localhost’
grant execute on function testdb.fn_add to ’dba’@’localhost’
注意:修改完权限以后 一定要刷新服务,或者重启服务,刷新服务用:FLUSH PRIVILEGES。
| 权限 | 说明 |
| all | |
| alter | |
| alter routine | 使用alter procedure 和drop procedure |
| create | |
| create routine | 使用create procedure |
| create temporary tables | 使用create temporary table |
| create user | |
| create view | |
| delete | |
| drop | |
| execute | 使用call和存储过程 |
| file | 使用select into outfile 和load data infile |
| grant option | 可以使用grant和revoke |
| index | 可以使用create index 和drop index |
| insert | |
| lock tables | 锁表 |
| process | 使用show full processlist |
| reload | 使用flush |
| replication client | 服务器位置访问 |
| replocation slave | 由复制从属使用 |
| select | |
| show databases | |
| show view |
| shutdown | 使用mysqladmin shutdown 来关闭mysql |
| super | |
| update | |
| usage | 无访问权限 |
mysql 用户权限管理详细的更多相关文章
- MYSQL用户权限管理学习笔记
MYSQL 用户管理 1.权限表 MYSQL是一个多用户的数据库,MYSQL的用户可以分为两大类: (1) 超级管理员用户(root),拥有全部权限 (2) 普通用户,由roo ...
- Mysql 用户权限管理
1. MySQL 权限介绍 mysql中存在4个控制权限的表,分别为user表,db表,tables_priv表,columns_priv表,我当前的版本mysql 5.7.22 . mysql权限表 ...
- Mysql 用户权限管理--从 xxx command denied to user xxx
今天遇到一个mysql 权限的问题,即标题所述 xxx command denied to user xxx,一般mysql 这种报错,基本都属于当前用户没有进行该操作的权限,需要 root 用户授 ...
- MYSQL用户权限管理GRANT使用
http://yanue.net/post-97.html GRANT语句的语法: mysql> grant 权限1,权限2,-权限n on 数据库名称.表名称 to 用户名@用户地址 iden ...
- mysql用户权限管理
参考文章:http://www.cnblogs.com/jackruicao/p/6068821.html?utm_source=itdadao&utm_medium=referral (1) ...
- MYSQL用户权限管理(Grant,Revoke)
MySQL可以为不同的用户分配严格的.复杂的权限.这些操作大多都可以用SQL指令Grant(分配权限)和Revoke(回收权限)来实现. Grant可以把指定的权限分配给特定的用户,如果这个用户不存在 ...
- mysql用户权限管理的问题
为了保证数据库安全,建立了若干个只能select的用户,但在权限授权的时候出现了不能连接的问题, 一个个尝试了一下,需要将 : 管理 -> SUPER项勾选才行(使用phpmyadmin),上 ...
- 练习:python 操作Mysql 实现登录验证 用户权限管理
python 操作Mysql 实现登录验证 用户权限管理
- Mysql数据库用户及用户权限管理,Navicat设置用户权限
Mysql数据库用户及用户权限管理,Navicat设置用户权限 一.Mysql数据库的权限 1.1 mysql数据库用户权限级别 1.2 mysql数据库用户权限 1.3 存放用户权限表的说明 二.用 ...
随机推荐
- WORM Worm worm 毛毛虫爬树爬树~
对于动态规划,我也就不多说了.因为还不会, 每个题都不一样,但大致原则是一样的.抓住题意, 本题:n棵树,毛毛虫在m分钟内从p到t的路线种数,毛毛虫只可以向左右相邻位置走. 中心代码: for(i = ...
- CSS-美化checkbox
注意:css3 的用: checked 伪类选择器会去检查元素属性(`input[checked]`),而不是 dom 节点上的属性( ``).所以要使用 jquery 的 prop 而非 attr ...
- 测开之路二十六:Flask基础之最小web程序
Flask中文文档:http://docs.jinkan.org/docs/flask/ 安装Flask库 选端口号的一种方法(避免和别人选的端口冲突,小于1024的时候重新选) 最小web程序 用1 ...
- mongo 数据库存储
mongo 数据库,获取有赞的数据. from app import mongo from app.external.yz.goods_api import YzGoodsApi from openp ...
- androidmanifest.xml 解码工具又来一发
背景: 最近这几天在研究facebook的协议,但是facebook的采用 SSL Pinning 技术,正常通过fiddler是不能解开SSL观察协议. 听说facebook app在 manife ...
- python 装饰器 第九步:使用类来作为装饰器
#第九步:使用类来作为装饰器 class kuozhan: #接收装饰器的参数(函数outer) def __init__(self,arg): print(self,arg)#arg就是la sel ...
- 希尔排序(shell)理论---不含源码
| 版权声明:本文为博主原创文章,未经博主允许不得转载. 希尔排序,是一个缩小增量排序.它根据步长来进行排序,步长不同可能会产生不同的序列,但是他们的最终结果是相同的,希尔排序的官方理论难以理解, ...
- 视区相关单位vw, vh ,vm,CSS/CSS3长度、时间、频率、角度单位大全
一.CSS长度值 em 相对于父元素的字体大小 ex 相对于小写字母"x"的高度 gd 一般用在东亚字体排版上,这个与英文并无关系 rem 相对于根元素字体大小 vw 相对于视窗的 ...
- [fw]Linux 的 time 指令
Linux 的 time 指令 Linux 有個很有意思的 time 指令,可以用來查看另一個指令的執行時間,例如執行 time helloworld 會顯示 helloworld 這支程式的執行 ...
- 【目录】sql server 架构篇系列
随笔分类 - sql server 架构篇系列 sql server 高可用镜像 摘要: 一.什么是数据库镜像 基本软件的高可用性解决方案 快速的故障转移恢复(3秒转移),低硬件成本 基于数据库级别的 ...