1、创建用户
# 指定本机登录 create user 'user'@'IP' identified by 'pwd'; # 创建可远程登录 create user 'user'@'%' identified by 'pwd';
2、删除用户
drop user 'user'@'host';
3、修改用户
rename user 'user'@'host' to 'NewUser'@'host';
4、修改密码
set password for 'user'@'host'=Password('NewPwd');
5、授权
#查看权限 show grants for 'user'@'host' #授予用户所有权限 grant all privileges on *.* to "user"@'host'; #取消用户所有权限 revoke all privileges on *.* from 'user'@'host';