码迷,mamicode.com
首页 > 数据库 > 详细

mysql创建数据库拥挤及分配权限

时间:2019-11-09 12:03:01      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:date   let   pac   撤销   ges   删除用户   delete   select   rop   

#查询数据库所有用户
SELECT USER,host FROM mysql.user
#新建数据库用户
create user tianxftest1@% IDENTIFIED by 456123
#赋予用户角色
revoke all PRIVILEGES on pmp_user.* FROM tianxftest1@% IDENTIFIED by 456123
#删除用户如下
drop user tianxftest1@192.168.222.110 ;
drop user tianxftest1@%;
#查看用户权限
show grants for tianxftest1;
#授权用户拥有数据库的所有权限
grant all privileges on fe.* to fe_group@localhost identified by 123456
#刷新权限表
flush privileges
#作用到某个数据库的具体某张表
grant select, insert, update, delete on testdb.orders to dba@localhost;
#作用到某张表的具体列上
grant select(id, se, rank) on testdb.apache_log to dba@localhost;
#撤销某个用户的某个权限
revoke all on *.* from dba@localhost; 

 

mysql创建数据库拥挤及分配权限

标签:date   let   pac   撤销   ges   删除用户   delete   select   rop   

原文地址:https://www.cnblogs.com/kiskistian/p/11824412.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!