MySQL重置密码(OSX)

1.停止MySQL的服务
sudo /Library/StartupItems/MySQLCOM/MySQLCOM stop
 
2.cd /usr/local/mysql/bin
./mysqld_safe --skip-grant-table
 
3.新开个终端
也是进入到mysql/bin目录
./mysql -u root mysql
use mysql;
UPDATE user SET Password=PASSWORD('root') where USER='root';
FLUSH PRIVILEGES;
 
退出 重启服务
sudo /Library/StartupItems/MySQLCOM/MySQLCOM restart
posted @ 2015-04-05 19:01  嗷大喵  阅读(473)  评论(0编辑  收藏  举报