MySQL forgot root password, reset password, and reset password after permission problem cannot login solution

Source: Internet
Author: User
Tags mysql command line

Since MySQL was not used for some time, I forgot the root login password.

Decide to reset the password and search for help.

Reference Documentation:

http://blog.csdn.net/odailidong/article/details/50770988

Http://www.cnblogs.com/emanlee/p/4621727.html

Reset Password:

1), enter the MySQL bin directory for the purpose of using the tool.

2) Stop the service and turn on the Ignore Logon permission verification step.

3) Open another CMD window, and the following ignores password authentication to log in directly to the MySQL command line operation, although this action restricts permission actions. If you want to use permission action, you should set the root password to be empty, this is something, please look down.

4) Change Password, there is a password encryption mode, the new version and the old version.

The new version uses the function: password (");

Old version: Old_password (")

For example:

Update Mysql.user Set Password=password ("123456") where user= ' root ';

5) Password modified successfully. Start the service.

6) Add some operations to the table user in the MySQL database.

7) A new issue occurs after a successful change. Such as.

8) Try, the problem changes slightly. is still unresolved.

Judging feelings is a matter of authority. However, there is no way to change permissions in the existing ways.

It is best to query the documentation and find a workable solution.

9)

Before you change the permissions, you need to reset the root password to null first. This allows you to execute the following statements that change permissions after logging in normally.

Ten) over.

MySQL forgot root password, reset password, and reset password after permission problem cannot login solution

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.