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

mysql-权限管理

时间:2017-06-08 23:41:26      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:ant   bsp   指定   class   with   ges   local   option   pre   

查询用户:
    select User from user;
    
授权权限:
    授予指定权限:
    grant insert,select on *.* to user_name@localhost with grant option; (*.*的意思:如:A.B => 数据库A中的表B)
    授予所有权限:
    grant all privileges on *.* to user_name@localhost with grant option;
        
查看权限:
    show grants for user_name@localhost;
    查看当前用户的权限:show grants;
    
回收权限:
    回收指定权限:
    revoke insert,select,grant option on *.* from user_name@localhost ...;
    回收所有权限:
    revoke all privileges,grant option from user@localhost ...;
    
    
    grant insert,select on *.* to zhangsan@localhost with grant option;
    show grants for zhangsan@localhost;

 

mysql-权限管理

标签:ant   bsp   指定   class   with   ges   local   option   pre   

原文地址:http://www.cnblogs.com/oural-yan/p/6952567.html

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