在mysql启动时$ mysql -u root -p
Enter password:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)在mysql已经关闭时返回错误代码ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)网上很多教程都是# /etc/init.d/mysql stop
# mysqld_safe --user=mysql --skip-grant-tables -- skip-networking &
# mysql -u root mysql
mysql> UPDATE user SET Password=PASSWORD('newpassword') where USER='root';
mysql> FLUSH PRIVILEGES;
mysql> quit但是mac根本没有/etc/init.d目录,求解
2 回答
守着星空守着你
TA贡献1799条经验 获得超8个赞
Mac 下忘记 MySQL root 密码,可以这样找回
# 不需要跑到 /etc/init.d 目录下,可以直接运行 mysqld_safe 命令 $ mysqld_safe --skip-grant-tables& $ mysql -u root mysql mysql> UPDATE user SET password=PASSWORD("new password") WHERE user='root'; mysql> FLUSH PRIVILEGES;
希望有所帮助~ :)
添加回答
举报
0/150
提交
取消