MySQL forgot password cannot log in

Source: Internet
Author: User

1. Edit MySQL config file My.ini (in MySQL installation directory, my D:\Program files\mysql\mysql Server 5.0\my.ini), add a line under [mysqld] This entry Skip-grant-tables Save exit and restart MySQL;

2,cmd inside input mysql-u root-p, login MySQL;

3, Enter MySQL database :

mysql> use MySQL;
Database changed

4.to set a new password for the root user:
mysql> Update user set Password=password ("xxx") where user= "root";
Query OK, 1 rows affected (0.01 sec)
Rows matched:1 changed:1 warnings:0

5. Comment out the skip-grant-tables added in the 1th step save exit and restart

MySQL forgot password cannot log in

Related Article

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.