创建用户
create user ‘alice’@’localhost’ identified by ‘123456’ ;
使用create user 语句创建的新用户没有任何权限
创建blake用户,密码123456
grant select,update,delete,insert on . to ‘blake’@’localhost’ identified by ‘123456’ ;
查询用户权限
use mysql;
select * from user where User=’blake’;
删除用户以及权限
drop USER ‘alice’@’localhost’ ;
修改用户名密码
update mysql.user set Password=password(‘123123’) where User=’blake’ ;
set password for ‘blake’@’localhost’=password(123123); #这个最好
回收update权限
revoke update on . from ‘alice’@’localhost’;
查看权限
show grants for ‘alice’@’localhost’;