這期內(nèi)容當(dāng)中小編將會(huì)給大家?guī)?lái)有關(guān)如何破解MySQL5.7 數(shù)據(jù)庫(kù)的root登錄密碼,文章內(nèi)容豐富且以專業(yè)的角度為大家分析和敘述,閱讀完這篇文章希望大家可以有所收獲。
讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:主機(jī)域名、虛擬主機(jī)、營(yíng)銷軟件、網(wǎng)站建設(shè)、開原網(wǎng)站維護(hù)、網(wǎng)站推廣。
導(dǎo)讀 | 本文檔詳細(xì)介紹破解 MySQL5.7 數(shù)據(jù)庫(kù)的 root 登錄密碼 |
忘記 root 登錄密碼
[root@MySQL1 ~]# mysql -uroot -p1231234 mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
在 /etc/my.cnf 配置文件中添加 skip-grant-tables 繞開 MySQL5.7 數(shù)據(jù)庫(kù)密碼驗(yàn)證
[root@MySQL1 ~]# echo skip-grant-tables >> /etc/my.cnf [root@MySQL1 ~]# /etc/init.d/mysqld restart Shutting down MySQL.. SUCCESS! Starting MySQL. SUCCESS!
直接使用 mysql 命令登錄 MySQL5.7 數(shù)據(jù)庫(kù)并修改 root 登錄密碼
[root@MySQL1 ~]# mysql Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 3 Server version: 5.7.19-log Source distribution Copyright (c) 2000, 2017, 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> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement mysql> flush privileges; Query OK, 0 rows affected (0.00 sec) mysql> ALTER USER 'root'@'localhost' IDENTIFIED BY 'password'; Query OK, 0 rows affected (0.00 sec) mysql> quit Bye
注意:如果在執(zhí)行該步驟的時(shí)候出現(xiàn) ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement 錯(cuò)誤。則執(zhí)行下 flush privileges; 命令,再執(zhí)行該命令即可。
使用新密碼 password 登錄 MySQL5.7 數(shù)據(jù)庫(kù)
[root@MySQL1 ~]# mysql -uroot -ppassword mysql: [Warning] Using a password on the command line interface can be insecure. Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 4 Server version: 5.7.19-log Source distribution Copyright (c) 2000, 2017, 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> exit Bye
使用其他密碼不能登錄 MySQL5.7 數(shù)據(jù)庫(kù)
[root@MySQL1 ~]# mysql -uroot -ppasswordd mysql: [Warning] Using a password on the command line interface can be insecure. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
優(yōu)化
刪掉 /etc/my.cnf 里的 skip-grant-tables
[root@MySQL1 ~]# sed -i -e '/skip-grant-tables/d' /etc/my.cnf
重啟數(shù)據(jù)庫(kù)
[root@MySQL1 ~]# /etc/init.d/mysqld restart
上述就是小編為大家分享的如何破解MySQL5.7 數(shù)據(jù)庫(kù)的root登錄密碼了,如果剛好有類似的疑惑,不妨參照上述分析進(jìn)行理解。如果想知道更多相關(guān)知識(shí),歡迎關(guān)注創(chuàng)新互聯(lián)行業(yè)資訊頻道。
網(wǎng)站名稱:如何破解MySQL5.7數(shù)據(jù)庫(kù)的root登錄密碼
新聞來(lái)源:http://www.rwnh.cn/article14/gpojde.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供標(biāo)簽優(yōu)化、網(wǎng)站制作、服務(wù)器托管、云服務(wù)器、做網(wǎng)站、App設(shè)計(jì)
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請(qǐng)盡快告知,我們將會(huì)在第一時(shí)間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如需處理請(qǐng)聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時(shí)需注明來(lái)源: 創(chuàng)新互聯(lián)