MySql5.5 Forget the root password how to do _mysql

Source: Internet
Author: User
Tags flush mysql in reserved

Use mysql5.5, suddenly the root password forget, how can not login, very urgent people, how to solve it? The following through this article to introduce mysql5.5 forget root password solution, the need for friends to refer to the next bar

Method One:

Operating system: Windows operating system, XP or Win7.

C:\USERS\ADMINISTRATOR>CD C:\Program files\mysql\mysql Server 5.5\bin
C:\Program files\mysql\mysql Server 5.5\bin>net Stop MySQL

The MySQL service is stopping.

The MySQL service has stopped successfully.

C:\Program files\mysql\mysql Server 5.5\bin>mysqld--skip-grant-tables

You'll see the window cursor blink at the first position on the next line, which means it's started and doesn't need a tube.

Create a new command line window also into the E:\mysql5.5\bin directory, start MySQL

 C:\Program files\mysql\mysql Server 5.5\bin>mysql Welcome to the MySQL Monitor. Commands End With;
or \g. Your MySQL connection ID is 1 server version:5.5.36 mysql Community Server (GPL) Copyright (c), 2014, Oracle and/or its affiliates.
All rights reserved. Oracle is a registered trademark to Oracle Corporation and/or its affiliates.
The other names may is trademarks of their respective owners. Type ' help, ' or ' \h ' for help.
Type ' \c ' to clear the current input statement.
mysql> show databases; +--------------------+
|
Database | +--------------------+
| Information_schema | | MySQL | | Performance_schema | |
Test |
+--------------------+ 4 rows in Set (0.00 sec) mysql> use MySQL;
Database changed mysql> update user set Password=password (' Oracle ') where user= ' root ';
Query OK, 2 rows Affected (0.00 sec) rows Matched:2 changed:2 warnings:0 mysql> flush; Query OK, 0 rows affected (0.01 sec) mysql> quit Bye 

See if there is a Mysqld.exe process in the Task Manager, if so, kill.


C:\Program files\mysql\mysql Server 5.5\bin>net start MySQL

The MySQL service is starting.

The MySQL service has started successfully.

C:\Program files\mysql\mysql Server 5.5\bin>mysql-uroot-poracle
Welcome to the MySQL Monitor. Commands End With; or \g.
Your MySQL connection ID is 1
server version:5.5.36 mysql Community Server (GPL)
Copyright (c), 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark to Oracle Corporation and/or its
affiliates. The other names may is trademarks of their respective
owners.
Type ' help, ' or ' \h ' for help. Type ' \c ' to clear the current input statement.
Mysql>

Method Two:

Operating system: Windows operating system, XP or Win7.

1.dos Command Line window into E:\mysql5.5\bin, stop MySQL service

E:\mysql5.5\bin>net stop MySQL

Note: See if there are any mysqld.exe processes in the task manager, such as kill them all.

2. Start MySQL in a way that does not check permissions

E:\mysql5.5\bin>mysqld.exe--skip-grant-tables

You'll see the window cursor blink at the first position on the next line, which means it's started and doesn't need a tube.

3. Create a new command line window also into the E:\mysql5.5\bin directory, start MySQL

E:\mysql5.5\bin>mysql

4. Modify Root Password

Mysql>use MySQL
mysql>update user set Password=password (' New_password ') where user= ' root ';
Mysql>flush privileges;
Mysql>quit

5. See if there is a Mysqld.exe process in the Task Manager, if so, kill them all.

6. Restart MySQL, you can set up a new password login

e:\mysql5.5\bin>net start MySQL
e:\mysql5.5\bin>mysql-u Root-pnew_password that's all 
.

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.