重置MySQL root密码(Mac下)
时间:2021-07-01 10:21:17
帮助过:6人阅读
1. 关闭mysql服务器
sudo /usr/local/mysql/support-files/mysql.server stop
也可以在系统偏好里有个MySQL里关闭。
2. 更改安全级别
$ cd /usr/local/mysql/bin
$ sudo ./mysqld_safe --skip-grant-tables
3. 新建Terminal窗口改root密码
$ cd /usr/local/mysql/bin
$ ./mysql -u root
$mysql> FLUSH PRIVILEGES;
$mysql> ALTER USER ‘root‘@‘localhost‘ IDENTIFIED by ‘你的新密码‘;
$mysql> EXIT
4. 重启MySQL Server
重置MySQL root密码(Mac下)
标签:port alter server safe mys ant usr mina root密码