标签:分享 注释 ges roo flush ble my.cnf ant src
Mysql忘记root用户密码如何登陆?
绕开权限验证登陆。具体操作步骤如下:
1.修改my.cnf配置文件,在[mysqld]节点下增加skip-grant-tables
2.重启mysql
service mysql restart
3.使用root用户登陆,不用指定密码。mysql -h localhost -u root -P 3306
4.登陆成功后修改root密码
mysql> use mysql;
mysql> update user set password=password(‘xxxx‘) where user=‘root‘ and host=‘xxx.xxx.xxx.xxx‘;
mysql> flush privileges;
5.把my.cnf中的skip-grant-tables注释掉,重启mysql
6.再次登陆,需要使用密码,密码就是你刚才设置的密码
标签:分享 注释 ges roo flush ble my.cnf ant src
原文地址:http://www.cnblogs.com/codergo/p/6857772.html