Created
June 1, 2017 09:49
-
-
Save jpzhu/50a41c190cc3050d8558364739cdb25c to your computer and use it in GitHub Desktop.
mysql password mac
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. 停止mysql的自动启动。 | |
# 停止或恢复,具体路径需要根据自己机器做相应修改 | |
sudo launchctl unload -w /Library/LaunchDaemons/org.macports.mysql.plist | |
sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql.plist | |
ref:https://stackoverflow.com/questions/100948/how-do-you-stop-mysql-on-a-mac-os-install | |
2. 杀死mysqld进程,如果会持续重启可能需要重启机器 | |
3. 以safe方式运行mysqld | |
mysqld_safe -- skip-grant-tables | |
4. 以root账号登录并修改mysql.user表里root密码 | |
# 5.7 以后版本,Password字段变为 authentication_string | |
mysql> UPDATE user SET Password = password ( 'new-password' ) WHERE User = 'root' ; | |
ref: http://blog.csdn.net/u013378306/article/details/50466073 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment