macOS 安装8.0.11 mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password

找到系统偏好设置mySql组件 关闭服务

macOS 安装8.0.11 mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password

以上如果关闭不成功 进入终端

macOS 安装8.0.11 mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password

接下来返回上一级目录 进入bin文件夹 执行以下步骤 完成免密码验证

macOS 安装8.0.11 mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password

开启一个新到终端 执行以下命令 不需要密码直接进入 mysql 

mysql -uroot -p

刷新mysql系统权限:

macOS 安装8.0.11 mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password

重置密码:ALTER USER 'root'@'localhost' IDENTIFIED BY '你的新密码'; 

密码重置已完毕,可以试试登陆mysql。

执行 quit;退出mysql

macOS 安装8.0.11 mysql 报错ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password