欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

mysql5.6密碼忘記了該如何恢復-創(chuàng)新互聯(lián)

本文主要給大家簡單講講mysql5.6密碼忘記了該如何恢復,相關專業(yè)術語大家可以上網(wǎng)查查或者找一些相關書籍補充一下,這里就不涉獵了,我們就直奔主題吧,希望mysql5.6密碼忘記了該如何恢復這篇文章可以給大家?guī)硪恍嶋H幫助。

創(chuàng)新互聯(lián)建站專注于企業(yè)全網(wǎng)整合營銷推廣、網(wǎng)站重做改版、棗強網(wǎng)站定制設計、自適應品牌網(wǎng)站建設、H5建站、成都做商城網(wǎng)站、集團公司官網(wǎng)建設、外貿(mào)營銷網(wǎng)站建設、高端網(wǎng)站制作、響應式網(wǎng)頁設計等建站業(yè)務,價格優(yōu)惠性價比高,為棗強等各大城市提供網(wǎng)站開發(fā)制作服務。

實驗環(huán)境:

    1、centos7.3

    2、mysql5.6.35

實驗描述:

    原mysql僅root賬號可以登錄且有密碼保護,現(xiàn)在密碼已經(jīng)忘記無法找回。今天的目標就是通過破解,重置mysql的root密碼。

實驗進行時:

    1、開始之前確定mysql不用密碼已經(jīng)不能登錄了

[root@c73 mysql]# mysql
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@c73 mysql]#
[root@c73 ~]# mysql -u root -p654321 //用654321這個密碼也進不了。
Warning: Using a password on the command line interface can be insecure.
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)

    2、跳過授權進入mysql

[root@c73 mysql]# systemctl stop mysql //停止mysql
//由于我本身使用的是root賬號,mysql運行需要mysql賬號所以,增加了--user=mysql,
//這里主要是使用--skip-grant-tables參數(shù)跳過授權表
[root@c73 mysql]# mysqld --user=mysql --skip-grant-tables &
[1] 6022
[root@c73 mysql]# 2017-04-11 09:36:41 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2017-04-11 09:36:41 0 [Note] mysqld (mysqld 5.6.35) starting as process 6022 ...
2017-04-11 09:36:41 6022 [Note] Plugin 'FEDERATED' is disabled.
2017-04-11 09:36:41 6022 [Note] InnoDB: Using atomics to ref count buffer pool pages
2017-04-11 09:36:41 6022 [Note] InnoDB: The InnoDB memory heap is disabled
2017-04-11 09:36:41 6022 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-04-11 09:36:41 6022 [Note] InnoDB: Memory barrier is not used
2017-04-11 09:36:41 6022 [Note] InnoDB: Compressed tables use zlib 1.2.3
2017-04-11 09:36:41 6022 [Note] InnoDB: Using Linux native AIO
2017-04-11 09:36:41 6022 [Note] InnoDB: Using CPU crc32 instructions
2017-04-11 09:36:41 6022 [Note] InnoDB: Initializing buffer pool, size = 128.0M
2017-04-11 09:36:41 6022 [Note] InnoDB: Completed initialization of buffer pool
2017-04-11 09:36:41 6022 [Note] InnoDB: Highest supported file format is Barracuda.
2017-04-11 09:36:41 6022 [Note] InnoDB: 128 rollback segment(s) are active.
2017-04-11 09:36:41 6022 [Note] InnoDB: Waiting for purge to start
2017-04-11 09:36:42 6022 [Note] InnoDB: 5.6.35 started; log sequence number 1626007
2017-04-11 09:36:42 6022 [Note] Server hostname (bind-address): '*'; port: 3306
2017-04-11 09:36:42 6022 [Note] IPv6 is available.
2017-04-11 09:36:42 6022 [Note]   - '::' resolves to '::';
2017-04-11 09:36:42 6022 [Note] Server socket created on IP: '::'.
2017-04-11 09:36:42 6022 [Note] mysqld: ready for connections.
Version: '5.6.35'  socket: '/var/lib/mysql/mysql.sock'  port: 3306  MySQL Community Server (GPL)

[root@c73 mysql]# netstat -lnpt|grep 3306 //確定服務開啟成功
tcp6       0      0 :::3306                 :::*                    LISTEN      6022/mysqld         
[root@c73 mysql]# mysql  //無密碼進入mysql
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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> //成功進入^_^

    3、修改root密碼

mysql> set password for 'root'@'localhost' = password('654321');
ERROR 1290 (HY000): The MySQL server is running with the --skip-grant-tables option so it cannot execute this statement
// 在--skip-grant-tables模式下,以上修改密碼的方法是行不通了。
// 所以我們直接修改用戶表來更新密碼。
mysql> update mysql.user set password=password("654321") where user='root';
Query OK, 4 rows affected (0.00 sec) #更新成功了4條root用戶的密碼
Rows matched: 4  Changed: 4  Warnings: 0
// 最后別忘了刷新
mysql> flush privileges;
Query OK, 0 rows affected (0.00 sec)

mysql> exit //退出
Bye

    4、這時候我們再來用新密碼測試看看能不能進入吧

[root@c73 ~]# ps aux|grep mysql
mysql     6022  0.0 11.6 1038816 452312 pts/0  Sl   09:36   0:00 mysqld --user=mysql --skip-grant-tables
root      6113  0.0  0.0 112664   968 pts/1    R+   10:00   0:00 grep --color=auto mysql
[root@c73 ~]# kill -9 6022 //結束掉原來的mysql服務
[root@c73 ~]# systemctl start mysql 以正常模式開啟mysql服務
[root@c73 ~]# ps aux|grep mysql
mysql     6132  0.0  0.0 113252  1588 ?        Ss   10:00   0:00 /bin/sh /usr/bin/mysqld_safe --basedir=/usr
mysql     6310  1.8  2.8 698944 110984 ?       Sl   10:00   0:00 /usr/sbin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib64/mysql/plugin --log-error=/var/log/mysqld.log --pid-file=/var/run/mysqld/mysqld.pid --socket=/var/lib/mysql/mysql.sock
root      6337  0.0  0.0 112664   972 pts/1    R+   10:01   0:00 grep --color=auto mysql
[root@c73 ~]# mysql #測試不用密碼無法進入
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: NO)
[root@c73 ~]# mysql -u root -p654321 #測試使用新密碼進入成功^_^
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 3
Server version: 5.6.35 MySQL Community Server (GPL)

Copyright (c) 2000, 2016, 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>

實驗總結:

    密碼盡可能的保存好吧,如果是線上24小時不間斷的業(yè)務,出現(xiàn)這種情況必須重啟服務來處理,或多或少都會帶來一些不必要的麻煩。

mysql5.6密碼忘記了該如何恢復就先給大家講到這里,對于其它相關問題大家想要了解的可以持續(xù)關注我們的行業(yè)資訊。我們的板塊內容每天都會捕捉一些行業(yè)新聞及專業(yè)知識分享給大家的。

另外有需要云服務器可以了解下創(chuàng)新互聯(lián)cdcxhl.cn,海內外云服務器15元起步,三天無理由+7*72小時售后在線,公司持有idc許可證,提供“云服務器、裸金屬服務器、高防服務器、香港服務器、美國服務器、虛擬主機、免備案服務器”等云主機租用服務以及企業(yè)上云的綜合解決方案,具有“安全穩(wěn)定、簡單易用、服務可用性高、性價比高”等特點與優(yōu)勢,專為企業(yè)上云打造定制,能夠滿足用戶豐富、多元化的應用場景需求。

當前名稱:mysql5.6密碼忘記了該如何恢復-創(chuàng)新互聯(lián)
網(wǎng)頁路徑:http://chinadenli.net/article12/dosgdc.html

成都網(wǎng)站建設公司_創(chuàng)新互聯(lián),為您提供云服務器、軟件開發(fā)、定制開發(fā)做網(wǎng)站、網(wǎng)站排名、App開發(fā)

廣告

聲明:本網(wǎng)站發(fā)布的內容(圖片、視頻和文字)以用戶投稿、用戶轉載內容為主,如果涉及侵權請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內容未經(jīng)允許不得轉載,或轉載時需注明來源: 創(chuàng)新互聯(lián)

外貿(mào)網(wǎng)站制作