一、用户授权
select user,host from mysql.user; (查表里有哪些用户)
show grants for username@'host' (查看用户的授权信息)
grant select,insert,update on db.* to username@'host' identified by 'password';
二、撤销权限
revoke insert,update on db.* from username@'host' identified by 'password';
三、删除用户
drop user username@'ip';
5.7的用户授权 有所不同
先创建用户: create user username@'host' identified by 'password';
给用户授权: grant select,insert,update on db.* to username@'host';
刷新授权信息: flush privileges;
阅读(1080) | 评论(0) | 转发(0) |