小标
2018-10-15
来源 :
阅读 1535
评论 0
摘要:本文主要向大家介绍了MySQL数据库账号权限 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
本文主要向大家介绍了MySQL数据库账号权限 ,通过具体的内容向大家展现,希望对大家学习MySQL数据库有所帮助。
<
mysql权限分为全局权限、库权限、表权限,对应于mysql库里面的user表、db表、tables_priv表。
grant all privileges on *.* :操作mysql.user表
grant all privileges on db.* :操作mysql.db表
grant all privileges on db.table :操作mysql.tables_priv表
这三种操作分别对应不同的表,互不影响,赋予一个用户大粒度的权限,并不能收回小粒度的权限。
示例如下:
root@localhost:mysql3306.sock 14:02: [test]>grant all privileges on *.* to test@‘127.0.0.1‘;
Query OK, 0 rows affected (0.00 sec)
root@localhost:mysql3306.sock 14:03: [test]>revoke update on test.* from test@‘127.0.0.1‘;
ERROR 1141 (42000): There is no such grant defined for user ‘test‘ on host ‘127.0.0.1‘
root@localhost:mysql3306.sock 14:03: [test]>revoke update on test.a from test@‘127.0.0.1‘;
ERROR 1147 (42000): There is no such grant defined for user ‘test‘ on host ‘127.0.0.1‘ on table ‘a‘
本文由职坐标整理并发布,希望对同学们学习MySQL有所帮助,更多内容请关注职坐标数据库MySQL数据库频道!
喜欢 | 0
不喜欢 | 0
您输入的评论内容中包含违禁敏感词
我知道了

请输入正确的手机号码
请输入正确的验证码
您今天的短信下发次数太多了,明天再试试吧!
我们会在第一时间安排职业规划师联系您!
您也可以联系我们的职业规划师咨询:
版权所有 职坐标-一站式AI+学习就业服务平台 沪ICP备13042190号-4
上海海同信息科技有限公司 Copyright ©2015 www.zhizuobiao.com,All Rights Reserved.
沪公网安备 31011502005948号