MySQL password reset
MySQL password forgot what to do?! The following steps are how to reset the mysql password:
1. Open MySQL the configuration file, command: vim/etc/my.cnf . A new line of Skip-grantis added to the configuration file, as shown in the following:
650) this.width=650; "Src=" https://s5.51cto.com/wyfs02/M02/8E/8E/wKiom1jFDzSxMBazAAAuPEiKD4U265.png-wh_500x0-wm_ 3-wmp_4-s_2873809545.png "title=" 11.PNG "alt=" Wkiom1jfdzsxmbazaaaupeikd4u265.png-wh_50 "/>
2. Save and Exit!
3. Restart mysqld, command: Service mysqld restart
4.mysql-uroot Enter,
Use MySQL; #使用mysql库
Update user set password= ' 123 ' where user= ' root '; #更改user这个表
Flush privileges; #更新权限
650) this.width=650; "Src=" https://s1.51cto.com/wyfs02/M02/8E/8C/wKioL1jFD3Wz3VGOAAA_bnl-Q6o468.png-wh_500x0-wm_ 3-wmp_4-s_3206242573.png "title=" 22.PNG "alt=" Wkiol1jfd3wz3vgoaaa_bnl-q6o468.png-wh_50 "/>
5. After exiting, restore the reboot, command as follows:
V im/etc/my.cnf # open mysql config file, skip-grant front plus #
/etc/init.d/mysqldrestart # Restart MySQL ;
log in with a new password MySQL database, the command is as follows:
#mysql –uroot–p123456 can log into the database properly!
This article is from the "Wu Fei" blog, please be sure to keep this source http://wutengfei.blog.51cto.com/10942117/1905641
MySQL password reset