码迷,mamicode.com
首页 > 数据库 > 详细

mac Access denied for user 'root'@'localhost' (using password: YES)

时间:2015-11-27 10:47:45      阅读:297      评论:0      收藏:0      [点我收藏+]

标签:

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

mac Access denied for user 'root'@'localhost' (using password: YES)

标签:

原文地址:http://www.cnblogs.com/hwd-cnblogs/p/4999743.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!