I don't remember how to change the mysqlroot password in linux or windows.

Source: Internet
Author: User
This article introduces how to modify the root password in linux and windows. if you encounter such problems, you can refer to this article to modify your password.

This article introduces how to modify the root password in linux and windows. if you encounter such problems, you can refer to this article to modify your password.

If you forget the root password locally, try the following methods:

Start CMD and stop the service first.

Net stop mysql

Go to the bin folder under the mysql installation directory and enter

Mysqld-nt -- skip-grant-tables

Skip password detection

Then a new cmd window is opened.

Enter mysql and press enter to enter mysql as the root user.

Use mysql

Update user set password = password ("new password") where user = "root ";

Flush privileges;

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

Linux solution


This section describes how to use grub in all linux versions:

1. on the Grub boot loader menu, select the entry you want to enter and 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 to enter edit mode;

3. add "init =/bin/bash" at the end of the sentence and press enter;

4. press "B" to start the system.

In this way, we can get a bash shell. after entering the shell, the Mount mode of the root partition is read-only by default. we need to change it to writable; otherwise, the root password cannot be changed:

Mount-no remount, rw/
Passwd root
Sync
Mount-no remount, ro/
Reboot

In this way, the password of the root user of debian can be changed successfully.

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.