首页 > 数据库技术 > 详细

mysql-权限管理

时间:2017-06-08 23:28:08      阅读:381      评论:0      收藏:0      [点我收藏+]
查询用户:
    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-权限管理

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

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!