技术支持 常见问题 数据库相关常见问题 Mysql 忘记密码处理方法
Mysql 忘记密码处理方法
** 1.打开 my.cnf 配置文件:**
vim /etc/my.cnf
在[mysqld]段加 skip-grant-tables
** 2.重启服务: **
/etc/init.d/mysql restart
** 3.登陆数据库修改密码:**
mysql -uroot
use mysql;
select user,host,password from user;
update user set password=password("9ce9023d80") where user="root" and host="localhost";
flush privileges;
exit
vim /etc/my.cnf
在[mysqld]段删除 skip-grant-tables
** 4.重启服务: **
/etc/init.d/mysql restart