linuxmysqlroot密码忘记重置_MySQL
时间:2021-07-01 10:21:17
帮助过:16人阅读
1. 停止mysql服务 /etc/init.d/mysql stop
2. 在终端输入 /usr/local/mysql/bin/mysqld_safe --skip-grant-tables --user=root 此时mysql以跳过检测的模式运行
3. 打开另一个终端
输入 mysql -uroot 进入mysql ,
mysql> update mysql.user set Password=PASSWORD('密码') where user = 'root';
mysql> FLUSH PRIVILEGES;
4. 退出mysql
5. 启动mysql服务 /etc/init.d/mysql start
完成。