www.国产视频,一级看片免费视频囗交动图,波多野结衣高清无码中文456,中国一级特黄特级毛片,69mmWWW路cOm,天天摸夜夜摸黄片,aaaaaaaaa在线观看

綠色資源網(wǎng):您身邊最放心的安全下載站! 最新軟件|熱門(mén)排行|軟件分類|軟件專題|論壇轉(zhuǎn)帖|廠商大全

綠色資源網(wǎng)

技術(shù)教程
您的位置:首頁(yè)數(shù)據(jù)庫(kù)類MySQL → ubuntu下安裝了mysql 5 server忘記root密碼怎么辦?

ubuntu下安裝了mysql 5 server忘記root密碼怎么辦?

我要評(píng)論 2015/04/04 23:44:10 來(lái)源:綠色資源網(wǎng) 編輯:www.aimjoke.net [ ] 評(píng)論:0 點(diǎn)擊:536次

在ubuntu下安裝了mysql 5 server,結(jié)果不知道什么原因,安裝時(shí)輸入的root帳號(hào)密碼在使用時(shí)無(wú)論如何都不能通過(guò)數(shù)據(jù)庫(kù)服務(wù)器的驗(yàn)證。無(wú)奈只有重置mysql的root帳號(hào)密碼。查了一下,用了以下方法成功的重置了root帳號(hào)密碼

ubuntu下安裝了mysql5 server 忘記了root密碼怎么辦?怎樣重置root密碼呢?

停止mysql服務(wù):

代碼如下:

root@webserver:/home/webmaster# service mysql stop

接著采用忽略密碼認(rèn)證模式重新創(chuàng)建一個(gè)mysql服務(wù):

代碼如下:

root@webserver:/home/webmaster# mysqld --user=mysql --skip-grant-tables --skip-networking &

成功啟動(dòng)后返回PID及其它啟動(dòng)信息

代碼如下:

[1] 3591   root@webserver:/home/webmaster# 121005 2:59:27 [Note] Plugin 'FEDERATED' is disabled.   121005 2:59:27 InnoDB: The InnoDB memory heap is disabled   121005 2:59:27 InnoDB: Mutexes and rw_locks use GCC atomic builtins   121005 2:59:27 InnoDB: Compressed tables use zlib 1.2.3.4   121005 2:59:27 InnoDB: Initializing buffer pool, size = 128.0M   121005 2:59:27 InnoDB: Completed initialization of buffer pool   121005 2:59:27 InnoDB: highest supported file format is Barracuda.   121005 2:59:27 InnoDB: Waiting for the background threads to start   121005 2:59:28 InnoDB: 1.1.8 started; log sequence number 1595685   121005 2:59:28 [Note] mysqld: ready for connections.   Version: '5.5.24-0ubuntu0.12.04.1' socket: '/var/run/mysqld/mysqld.sock' port: 0 (Ubuntu)


連接到mysql系統(tǒng)庫(kù):

代碼如下:

root@webserver:/home/webmaster# mysql -u root mysql

連接到mysql庫(kù)后直接修改root帳號(hào)的密碼為新的密碼'mynewpasswd':

代碼如下:
 

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.    mysql> update user set Password=PASSWORD('mynewpasswd') where user='root';   Query OK, 3 rows affected (0.00 sec)   Rows matched: 3 Changed: 3 Warnings: 0    mysql> FLUSH PRIVILEGES;   mysql> quit;   Bye

中止mysql服務(wù)進(jìn)程(PID 3591見(jiàn)前面啟動(dòng)服務(wù)時(shí)的屏幕信息):
代碼如下:
 

root@webserver:/home/webmaster# kill 3591

正常啟動(dòng) mysql服務(wù),并用新密碼登錄mysql服務(wù)器成功:
代碼如下:
 

root@webserver:/home/webmaster#service mysql start   
root@webserver:/home/webmaster#mysql -u root -pmynewpasswd

關(guān)鍵詞:ubuntu,mysql

閱讀本文后您有什么感想? 已有 人給出評(píng)價(jià)!

  • 1 歡迎喜歡
  • 30 白癡
  • 1 拜托
  • 23 哇
  • 32 加油
  • 72 鄙視