Mysql 8.0 版本命令行方式修改密码

 Mysql 8.0 版本命令行方式修改密码

Mysql 8.0 设置密码的方式有所变更,这里记录一下

将当前需要操作的数据库名切到’mysql’

USE mysql;

本机访问方式

ALTER USER 'username'@'localhost' identified by 'password';

外网访问方式

ALTER USER 'username'@'%' identified by 'password';

最后

FLUSH PRIVILEGES;

使生效

❤️ 如果这篇文章对您有帮助,欢迎打赏支持

微信打赏二维码

扫描上方二维码,用微信打赏

吴川斌

吴川斌

Leave a Reply