Windows host MySQL forgot password how to reset

Source: Internet
Author: User

This article is written mainly for the problem of "mysqld is not an internal command or external command " during the MySQL reset password process.
There are many articles on the internet about how to get back the password of MySQL, but many of them are not detailed enough, especially the DOS command, which may be a problem for a large part of the friends who have just contacted this area. This article on the online tutorial has difficult and confused steps to re-analysis, if you can take less than a detour, then my purpose is achieved. The following is the most popular online method, the original author does not know, here to express thanks.

  1. Close the running MySQL.
  2. Open the DOS window and go to the Mysqlbin directory.
  3. Enter mysqld--skip-grant-tables carriage return. If the message doesn't appear, it's right.
  4. Open a DOS window again (because the DOS window just can't move), go to the Mysqlbin directory.
  5. Enter MySQL return and if successful, a MySQL prompt will appear >
  6. Connection rights database >use MySQL; (> is the original cue, don't forget the last semicolon)
  7. Change Password:> update user set Password=password ("123456") where user= "root"; (Don't forget the last semicolon)
  8. Refresh permissions (required steps) >flush privileges;
  9. Exit > Q
  10. Log out of the system, then enter, open MySQL, use the username root and just set the new password 123456 to login.

The main step is second: "Open the DOS window and go to the Mysqlbin directory." ”
may have children's shoes do not know how to operate this step
The specific is: Use the Win+r key, open run, type cmd hit return to the DOS window. Then find Mysql/bin in the directory, I am using Apmserv built server environment, the program is installed in the C packing directory, so my directory is in the C:apmserv5.2.6apmserv5.2.6mysql5.1bin. If you are using Phpnow to build the environment, then your installation directory should be your own designation, find it, copy the address, and then back to CMD, enter the CD (there is a space behind the CD), and then right-click on the copied path, press ENTER. It goes to the Mysql/bin directory.
Or, more simply, create a new text document in the MySQL installation directory and enter
Cmd.exe
Save, and then change the document's suffix name to a. bat batch file, double-click open to switch directly to the directory. And that's where the problem lies, and we follow this step
"Enter mysqld--skip-grant-tables carriage return. If the message does not appear, then the "
What is the reason for the prompt "mysqld is not an internal command or external command" after entering Mysqld--skip-grant-tables? If you come across this hint, change the order to Mysqld-nt--skip-grant-tables and you're done.
OK, the problem also solved, the other follow the original tutorial steps to OK, it is important to note that the following three steps in the final semicolon can not be forgotten.

Connection rights database >use MySQL;
Change Password:> update user set Password=password ("520") where user= "root";
Refresh permissions (required steps) >flush privileges;


Summary: This problem is found because the MySQL version used is too low, because later version of the update will not mysqld-nt.exe this file, that is, only the online mysqld.exe of the tutorial. More, if you install the new version of MySQL will not appear this problem.

From:http://www.augsky.com/78.html

Windows host MySQL forgot password how to reset

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.