I don't remember linux/windows. mysql Root password Universal modification method

Source: Internet
Author: User

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

Open cmd first stop MySQL service

net stop MySQL

Enter the Bin folder in the MySQL installation directory and enter

Mysqld-nt--skip-grant-tables

Skip Password detection

Then another new CMD window opens

Enter MySQL direct return can enter MySQL with root privileges

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.

How Linux is handled


Describes a method that can be used on all versions of Linux on grub:

1, on the Grub Boot loader menu, select the entry you want to enter, type "E" to enter the editing mode;

2, in the second line (similar to kernel/vmlinuz-2.6.15 ro root=/dev/hda2), type "E" into the editing mode;

3, at the end of the sentence plus "Init=/bin/bash", enter;

4, press "B" to start the system.

So we can get a bash shell, after entering the shell, the mount mode of the root partition is read-only by default, we have to change it to writable, otherwise the root password cannot be changed:

Mount-no REMOUNT,RW/
passwd Root
Sync
Mount-no Remount,ro/
Reboot

This will successfully change the password of the Debian root user

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.