给mysql添加一个只有某个数据库查询权限的用户
# 添加用户:
insert into mysql.user(Host,User,Password,ssl_cipher,x509_issuer,x509_subject) values ("%","ysk",password("123456"),'','','');
#授权:
grant select on test.* to 'ysk'@'%';
#刷新:
flush privileges;
#查看授权情况
SHOW GRANTS FOR allen;
#删除用户:
DROP USER allen;
原创
2020-11-26 21:18:17 ·
583 阅读 ·
0 评论