《Mysql實(shí)例MySql5.5忘記root密碼怎么辦》要點(diǎn):
本文介紹了Mysql實(shí)例MySql5.5忘記root密碼怎么辦,希望對(duì)您有用。如果有疑問,可以聯(lián)系我們。
使用mysql5.5,突然root密碼忘記,怎么也登錄不了,很急人,該怎么解決呢?下面通過本文給大家介紹mysql5.5忘記root密碼的解決辦法,需要的朋友參考下吧MYSQL入門
方法一:MYSQL入門
操作系統(tǒng):windows操作系統(tǒng),xp或win7.
MYSQL入門
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
MYSQL入門
MySQL 服務(wù)正在停止.
MYSQL入門
MySQL 服務(wù)已成功停止.MYSQL入門
C:\Program Files\MySQL\MySQL Server 5.5\bin>mysqld --skip-grant-tables
MYSQL入門
你會(huì)看到窗口光標(biāo)在下一行的第一個(gè)位置閃爍,這說明已經(jīng)啟動(dòng)了,不需要管.MYSQL入門
新建一個(gè)命令行窗口同樣進(jìn)入到e:\mysql5.5\bin目錄,啟動(dòng)mysql
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) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be 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 privileges; Query OK, 0 rows affected (0.01 sec) mysql> quit Bye
看看那任務(wù)管理器中是否有mysqld.exe進(jìn)程,如有,kill .
MYSQL入門
MYSQL入門
C:\Program Files\MySQL\MySQL Server 5.5\bin>net start mysql
MYSQL入門
MySQL 服務(wù)正在啟動(dòng) .
MYSQL入門
MySQL 服務(wù)已經(jīng)啟動(dòng)成功.
MYSQL入門
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) 2000, 2014, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql>
方法二:MYSQL入門
操作系統(tǒng):windows操作系統(tǒng),xp或win7.MYSQL入門
1.dos命令行窗口 進(jìn)入e:\mysql5.5\bin ,停止mysql 服務(wù)MYSQL入門
e:\mysql5.5\bin>net stop mysqlMYSQL入門
注意:看看那任務(wù)管理器中是否有mysqld.exe進(jìn)程,如有,kill them all.MYSQL入門
2. 以不檢查權(quán)限的方式啟動(dòng)mysqlMYSQL入門
e:\mysql5.5\bin>mysqld.exe --skip-grant-tablesMYSQL入門
你會(huì)看到窗口光標(biāo)在下一行的第一個(gè)位置閃爍,這說明已經(jīng)啟動(dòng)了,不需要管.MYSQL入門
3. 新建一個(gè)命令行窗口同樣進(jìn)入到e:\mysql5.5\bin目錄,啟動(dòng)mysqlMYSQL入門
e:\mysql5.5\bin>mysqlMYSQL入門
4. 修改root密碼MYSQL入門
mysql>use mysql mysql>update user set password=PASSWORD('new_password') where user='root'; mysql>flush privileges; mysql>quit
5. 看看那任務(wù)管理器中是否有mysqld.exe進(jìn)程,如有,kill them all.MYSQL入門
6. 重啟mysql,就可以用你設(shè)置新密碼登陸MYSQL入門
e:\mysql5.5\bin>net start mysql e:\mysql5.5\bin>mysql -u root -pnew_password that's all .
維易PHP培訓(xùn)學(xué)院每天發(fā)布《Mysql實(shí)例MySql5.5忘記root密碼怎么辦》等實(shí)戰(zhàn)技能,PHP、MYSQL、LINUX、APP、JS,CSS全面培養(yǎng)人才。
轉(zhuǎn)載請(qǐng)注明本頁網(wǎng)址:
http://www.snjht.com/jiaocheng/11463.html