mac Access denied for user 'root'@'localhost' (using password: YES)
1:苹果->系统偏好设置->最下边点mysql 在弹出页面中 关闭mysql服务
2: Start it in safe mode
进入终端
输入:
cd /usr/local/mysql/bin/
回车后 登录管理员权限
sudo su
回车后输入以下命令来禁止mysql验证功能
./mysqld_safe --skip-grant-tables &
3) Open another terminal and run the following command (Keep last terminal open)
mysql -u root
4) Run the following command with suitable new password on the mysql console
mysql > UPDATE mysql.user SET Password=PASSWORD('password') WHERE User='root';
5) mysql > FLUSH PRIVILEGES;
6) Quit from both terminals and open new terminal and connect to mysql with root user and new password
mysql -uroot -p
【推荐】还在用 ECharts 开发大屏?试试这款永久免费的开源 BI 工具!
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步