MySQL forgot password, how to do?

Source: Internet
Author: User

MySQL forgot password, how to do?

We often need to modify the MySQL password, such as a long time to forget the MySQL password, or the use of a computer someone else used, do not know the previous password, and want to use MySQL, how to do?

 

Preparatory work:

Locate the MySQL installation path (method below)

650) this.width=650; "title=" clip_image002.jpg "alt=" wkiol1qsnwwy_7mzaacexrvkciw911.jpg "src=" http://s3.51cto.com/ Wyfs02/m00/49/4d/wkiol1qsnwwy_7mzaacexrvkciw911.jpg "/>

650) this.width=650; "Title=" 9[@x~vn1aofub0 (F ' b[2v$8.jpg "alt=" wkiol1qsnx-buttgaagn6vbgq00856.jpg "src=" http:/ S3.51cto.com/wyfs02/m01/49/4d/wkiol1qsnx-buttgaagn6vbgq00856.jpg "/>

The preparation is done.

1, close the running MySQL.

2, in the DOS window, go to the MySQL installation directory below.

650) this.width=650; "title=" gnfx~2%33c) n{_jg~2{a]oh.png "alt=" wkiom1qsnzuxe5g0aafuxdrfkqk928.jpg "src="/http S3.51cto.com/wyfs02/m01/49/4b/wkiom1qsnzuxe5g0aafuxdrfkqk928.jpg "/>

3, enter Mysqld–skip-grant-tables carriage return. If the message doesn't appear, it's right.

4, open a DOS window, follow the way, find the MySQL installation directory, enter the MySQL return, if successful, will appear mysql>

650) this.width=650; "title=" R $ $PDX $_cr) @FG3 ' t4}2@%2.png ' alt= ' wkiom1qsnayxo0lpaaillevyi_u334.jpg ' src= '/http S3.51cto.com/wyfs02/m01/49/4b/wkiom1qsnayxo0lpaaillevyi_u334.jpg "/>

5, connect permissions database use MySQL;

6, Change Password:

Update user set password= "1234" where user= "root"; (don't forget the last semicolon.) ) 1234 for the newly set password

650) this.width=650; "title=" B2f2~${h44]n0h4s ' od%p4a.jpg "alt=" wkiol1qsndwrm3ihaabpuie5see234.jpg "src=" http:/ S3.51cto.com/wyfs02/m02/49/4d/wkiol1qsndwrm3ihaabpuie5see234.jpg "/>

7, Refresh permissions > Flush privileges;

8, Exit > \q

9, re-open MySQL, using the user name root, password 1234 can log in.

MySQL forgot password, how to do?

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.