Forget root password Ultimate Modify MySQL password method

Source: Internet
Author: User

Forget root password in Windows


If you have forgotten the root password locally, try the following methods:

Open cmd first stop MySQL service

The code is as follows Copy Code

net stop MySQL

Enter the Bin folder in the MySQL installation directory and enter

The code is as follows Copy Code

Mysqld-nt--skip-grant-tables

Skip Password detection

Then another new CMD window opens

Enter MySQL direct return can enter MySQL with root privileges

The code is as follows Copy Code

Use MySQL

Update user set Password=password ("New password") where user= "root";

Flush privileges;

If no error is prompted, the password can be changed successfully.

Forget root password in Linux

Linux Root has the supremacy of power, once the root password forgotten or stolen, is a very headache, then how to retrieve the root password, I summed it up as follows:
(i) Linux system password cracking

1. Enter edit mode by E in the Grub options menu
2. (press e) Edit kernel line add/init 1 (or/single)
3. Restart by B
4. After entering, execute the following command

The code is as follows Copy Code

#vi/etc/passwd into passwd file

The first line of the root:x:0 .... In the x Delete, become root::0 .... Then save the exit!

In the system at this time the root password is empty.

Modify password

  code is as follows copy code

#passwd Root

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.