mysql 权限管理

Posted dingyingsi

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了mysql 权限管理相关的知识,希望对你有一定的参考价值。

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 [email protected]"%";  
revoke all on db1.tb1 from [email protected]"%";  
revoke all on db1.* from [email protected]"%";  

 


以上是关于mysql 权限管理的主要内容,如果未能解决你的问题,请参考以下文章