欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

mysql8创建用户

程序员文章站 2024-02-19 16:33:16
...

mysql8以后创建用户和权限管理的命令略有修改

  1. 创建用户
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 ;