您好,登錄后才能下訂單哦!
本篇內(nèi)容介紹了“mysql的密碼忘記了怎么辦”的有關(guān)知識(shí),在實(shí)際案例的操作過(guò)程中,不少人都會(huì)遇到這樣的困境,接下來(lái)就讓小編帶領(lǐng)大家學(xué)習(xí)一下如何處理這些情況吧!希望大家仔細(xì)閱讀,能夠?qū)W有所成!
Windows下的實(shí)際操作如下
1.關(guān)閉正在運(yùn)行的MySQL。
2.打開(kāi)DOS窗口,轉(zhuǎn)到mysqlin目錄。
3.輸入mysqld --skip-grant-tables回車。如果沒(méi)有出現(xiàn)提示信息,那就對(duì)了。
4.再開(kāi)一個(gè)DOS窗口(因?yàn)閯偛拍莻€(gè)DOS窗口已經(jīng)不能動(dòng)了),轉(zhuǎn)到mysqlin目錄。
5.輸入mysql回車,如果成功,將出現(xiàn)MySQL提示符 >
6. 連接權(quán)限>use ; (>是本來(lái)就有的提示符,別忘了最后的分號(hào))
6.改密碼:> update user set password=password("520") where user="root"; (別忘了最后的分號(hào))
7.刷新權(quán)限(必須的步驟)>flush privileges;
8.退出 > q
9.注銷系統(tǒng),再進(jìn)入,開(kāi)MySQL,使用用戶名root和剛才設(shè)置的新密碼123456登陸。
第一步
C:Documents and SettingsAdministrator>cd D:webwww.2cto.comMysqlMySQL Se
rver5.5in
C:Documents and SettingsAdministrator>d:
D:webwww.2cto.comMysqlMySQL Server5.5in>mysqld --skip-grant-tables
第二步
Microsoft Windows [版本 5.2.3790]
(C) 版權(quán)所有 1985-2003 Microsoft Corp.
C:Documents and SettingsAdministrator>cd D:webwww.2cto.comMysqlMySQL Se
rver5.5in
C:Documents and SettingsAdministrator>d:
D:webwww.2cto.comMysqlMySQL Server5.5in>mysql
Welcome to the MySQL monitor. Commands end with ; or g.
Your MySQL connection id is 1
Server version: 5.5.10 MySQL Community Server (GPL)
Copyright (c) 2000, 2010, 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> use mysql;
Database changed
mysql> update user set password=password("520") where user="root";
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)
mysql> q
Bye
D:webwww.2cto.comMysqlMySQL Server5.5in>
“mysql的密碼忘記了怎么辦”的內(nèi)容就介紹到這里了,感謝大家的閱讀。如果想了解更多行業(yè)相關(guān)的知識(shí)可以關(guān)注億速云網(wǎng)站,小編將為大家輸出更多高質(zhì)量的實(shí)用文章!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。