Mysql 8.0 设置密码的方式有所变更,这里记录一下
将当前需要操作的数据库名切到’mysql’
USE mysql;
本机访问方式
ALTER USER 'username'@'localhost' identified by 'password';
外网访问方式
ALTER USER 'username'@'%' identified by 'password';
最后
FLUSH PRIVILEGES;
使生效
wechat原创文章,转载请注明: 转载自 https://www.mr-wu.cn
本文链接地址: Mysql 8.0 版本命令行方式修改密码 https://www.mr-wu.cn/how-to-reset-user-password-in-mysql-8-0/