MySQL password reset

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.