mysql授权用户权限
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 | 无访问权限 |
mysql授权用户权限的更多相关文章
- mysql 赋予用户权限
# 赋予权限MySQL> grant 权限参数 on 数据库名称.表名称 to 用户名@用户地址 identified by '用户密码'; # 立即生效权限MySQL> flush pr ...
- 转: MySQL 赋予用户权限(grant %-远程和localhost-本地区别)
相关参考资料: MySQL 赋予用户权限命令的简单格式可概括为: grant 权限 on 数据库对象 to 用户 一.grant 普通数据用户,查询.插入.更新.删除 数据库中所有表数据的权利. gr ...
- mysql grant用户权限设置
MySQL 赋予用户权限命令的简单格式可概括为: grant 权限 on 数据库对象 to 用户 一.grant 普通数据用户,查询.插入.更新.删除 数据库中所有表数据的权利. grant sele ...
- Java基础91 mysql的用户权限设置问题
1.概述 1)MySQL数据库中root用户具有最高的权限(超级用户),可以对任何数据库,任何表进行操作. 2)权限账户,只拥有部分权限(CRUD) .例如:只能操作某个数据库的某张表等等. 2.my ...
- mysql grant 用户权限说明
mysql grant 用户权限说明 Mysql 有多个个权限?经常记不住,今天总结一下,看后都能牢牢的记在心里啦!! 很明显总共28个权限:下面是具体的权限介绍:转载的,记录一下: 一.权限表 my ...
- mysql 的用户权限
查看MySQL的用户权限 show grants for "username"@'host'; 添加新用户 允许本地IP访问localhost:127.0.0.1 use mysq ...
- MySQL 赋予用户权限(grant %-远程和localhost-本地区别)
不过有些时候(有些版本)'%'不包括localhost,要单独对@'localhost'进行赋值,这事真让我遇上了,在对mysql5.1.32建立远程用户时. 分别对'%'和'localhost'授权 ...
- mysql 操作用户权限
使用可以对mysql数据库用户表有操作权限的用户名登陆mysqlinsert into user(Host,User,Password) values('%','name','password');如 ...
- MYSQL 备份用户权限
MYSQL 备份用户权限 datadbblack 192.168.1.10 是 SELECT, RELOAD, SHOW DATABASES, LOCK TABLES 否 权限列表 1.Select ...
随机推荐
- @codeforces - 793G@ Oleg and chess
目录 @description - translation@ @solution@ @part - 1@ @part - 2@ @part - 3@ @part - 4@ @accepted code ...
- 【iOS知识学习】_int、NSInteger、NSUInteger、NSNumber的差别和联系
版权声明:本文为博主原创文章.未经博主同意不得转载. https://blog.csdn.net/weasleyqi/article/details/33396809 1.首先先了解下NSNumber ...
- Java帮助文档打开索引就停止服务
cmd: regsvr32 jscript.dllregsvr32 hhctrl.ocxregsvr32 itss.dllregsvr32 itircl.dll
- oracle函数 NLS_LOWER(x[,y])
[功能]返回字符串并将字符串的变为小写; [参数]x字符型表达式 [参数]Nls_param可选,指定排序的方式(nls_sort=) . SCHINESE_RADICAL_M(部首.笔画) SCHI ...
- 为什么有时候Css样式表某个属性引用不成功?
首次使用博客,很多东西都在探索,第一篇文章也不知道发布点什么,就随便写写,是在word里面写的,也懒得排版,将就这用吧. 闲着没事找了酷狗的API写了个简单的静态网页,完成了搜索,展示,播放功能.就想 ...
- Android 使用ViewPager结合PhotoView开源组件实现网络图片在线浏览功能
在实际的开发中,我们市场会遇到这样的情况:点击某图片,浏览某列表(某列表详情)中的所有图片数据,当然,这些图片是可以放大和缩小的,比如我们看下百度贴吧的浏览大图的效果: 链接 这种功能,在一些app ...
- Android Studio(七):项目从Eclipse到Android Studio迁移
Android Studio相关博客: Android Studio(一):介绍.安装.配置 Android Studio(二):快捷键设置.插件安装 Android Studio(三):设置Andr ...
- H3C TCP/UDP端口号
- Spring Data JPA坑点记录
本篇进行Spring-data-jpa的介绍,几乎涵盖该框架的所有方面,在日常的开发当中,基本上能满足所有需求.这里不讲解JPA和Spring-data-jpa单独使用,所有的内容都是在和Spring ...
- H3C 三种生成树协议特性的比较