MySQL8账号密码和权限的常用操作

生态人

关注

阅读 95

2022-04-14

修改 root 的密码

alter user 'root'@'localhost' indentified by '111111';

-- 解决 cache_sha2_password 问题 
alter user 'test'@'%' indentified WITH mysql_native_password by '111111';

flush privileges;

创建用户并设置权限

CREATE USER 'test'@'%' IDENTIFIED BY '111111';

grant all privileges on *.* to test@% ;
flush privileges;

精彩评论(0)

0 0 举报