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

mysql 权限管理

时间:2018-04-16 12:10:25      阅读:168      评论:0      收藏:0      [点我收藏+]

标签:rom   撤销   use   权限   sel   user   date   drop   mysq   

1.创建用户

CREATE USER dingyingsi@localhost IDENTIFIED BY dys123; //将该用户创建在本机上
CREATE USER dingyingsi@% IDENTIFIED BY dys123;  //创建的用户可以远程连接本机

2.授权

grant select,insert,update,delete,create,drop on dys.tb1 to dingyingsi@localhost identified by dys123;
grant all privileges on dys.tb1 to dingyingsi@localhost identified by dys123;
grant all privileges on *.* to dingyingsi@localhost identified by dys123;

3.撤销权限

revoke all privileges on *.* from netuser@"%";  
revoke all on db1.tb1 from netuser@"%";  
revoke all on db1.* from netuser@"%";  

 

mysql 权限管理

标签:rom   撤销   use   权限   sel   user   date   drop   mysq   

原文地址:https://www.cnblogs.com/dingyingsi/p/8855019.html

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