Mysql5.6: How to forget the root password? mysql5.6root

Source: Internet
Author: User

Mysql5.6: How to forget the root password? mysql5.6root

View the currently installed mysql version:

Root @ oraserver139 ~] # Rpm-qa | grep MySQL
MySQL-server-5.6.15-1.el6.x86_64
MySQL-client-5.6.15-1.el6.x86_64
MySQL-shared-compat-5.6.15-1.el6.x86_64
MySQL-devel-5.6.15-1.el6.x86_64
Perl-DBD-MySQL-4.022-1.el6.rfx.x86_64

1. First, net stop mysql service, and switch to the task manager, there are mysql-related, it is best to close the process.

2. Run the CMD command to switch to the MySql installation bin directory. The following is my mysql installation directory.

cd D:/Program Files/MySQL/MySQL Server 5.6/bin

Then execute mysqld -- skip-grant-tables (note that there is no semicolon ;)

The following prompt message appears,

Do not close this command line window and open a new command line window again. Note: At this time, a warning may appear, so ignore it.

3. Open a new cmd window again. Run the following command in the bin directory: mysql-u root-p. Enter the password and press Enter,

For example


4. Execute the command: update mysql. user set password = PASSWORD ('root') where User = 'root ';

In this way, the root user password is set to root.

5. Refresh and execute: mysql> flush privileges ;.

Now you can log on again. The password is successfully modified.

The solution to Mysql5.6 forgetting the root password is introduced here, and I would like to thank you for your constant support for the help House website.

Articles you may be interested in:
  • How to change the Secure Password of MySQL 5.6
  • How to view or modify the Root password of Mysql)
  • MySQL-four methods for modifying the root password (take windows as an example)
  • How to change the root password without restarting Mysql
  • How to change the default mysql null password (root password) in xampp

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.