mysql8以后创建用户和权限管理的命令略有修改
- 创建用户
create user 'test1'@'localhost' identified by '‘密码';
2、修改密码
alter user 'test1'@'localhost' identified by '新密码';
3、授权
grant all privileges on *.* to 'test1'@'localhost' with grant option;
4、查看权限
show grants for 'test1'@'localhost';
5、撤销权限
revoke all privileges on *.* from 'test1'@'localhost';
6、删除用户
drop user 'test1'@'localhost';
7、刷新权限
FLUSH PRIVILEGES ;