偷偷摘套内射激情视频,久久精品99国产国产精,中文字幕无线乱码人妻,中文在线中文a,性爽19p

一個(gè)MySQL數(shù)據(jù)庫(kù)非法關(guān)機(jī)造成數(shù)據(jù)表?yè)p壞的實(shí)例

數(shù)據(jù)庫(kù) MySQL
本文主要介紹了修復(fù)由于非法硬件關(guān)機(jī)造成MySQL數(shù)據(jù)庫(kù)數(shù)據(jù)表?yè)p壞的過(guò)程,希望能夠?qū)δ兴鶐椭?/div>

本文我們介紹由于非法硬件關(guān)機(jī),造成了MySQL數(shù)據(jù)庫(kù)數(shù)據(jù)表?yè)p壞,數(shù)據(jù)庫(kù)不能正常運(yùn)行的一個(gè)實(shí)例,接下來(lái)是作者排查錯(cuò)誤的過(guò)程,讓我們來(lái)一起了解一下吧。

排查修復(fù)數(shù)據(jù)表的經(jīng)過(guò)如下:

 

1、訪問(wèn)網(wǎng)頁(yè),提示錯(cuò)誤,連接不到數(shù)據(jù)庫(kù)。

2、啟動(dòng)mysql服務(wù),卸載和關(guān)閉rpm安裝的mysql服務(wù)(昨天安裝postfix好像yum安裝了mysql),用netstat -anp |grep mysqld 命令查看mysql服務(wù)沒(méi)有起來(lái),用mysql -uroot -p也連接不到服務(wù)器。

3、查看錯(cuò)誤提示:

 

  1. 110726 17:02:23 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.  
  2.  
  3. 110726 17:02:23 [ERROR] /usr/local/mysql/libexec/mysqld: Table './mysql/host' is marked as crashed and last (automatic?) repair failed  
  4.  
  5. 110726 17:02:23 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/host' is marked as crashed and last (automatic?) repair failed  
  6.  
  7. 110726 17:02:23 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended  
  8.  
  9. 110726 17:24:31 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql  
  10.  
  11. 110726 17:24:31 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead. 

 

發(fā)現(xiàn)提示數(shù)據(jù)庫(kù)表?yè)p壞。(./mysql/host)

4、修復(fù)數(shù)據(jù)庫(kù)表:

 

  1. cd /var/lib/mysql/mysql  
  2.  
  3. myisamchk -of host.MYI  
  4.  
  5. - recovering (with keycache) MyISAM-table 'host.MYI'  
  6.  
  7. Data records: 0  
  8.  
  9. 表host.MYI修復(fù)成功。 

 

5、再次啟動(dòng)服務(wù),查看服務(wù)是否啟動(dòng),登錄mysql,還是不行。所以再次查看錯(cuò)誤日志。

 

  1. /usr/local/mysql/libexec/mysqld: Table './mysql/plugin' is marked as crashed and last (automatic?) repair failed  
  2.  
  3. /usr/local/mysql/libexec/mysqld: Table 'plugin' is marked as crashed and last (automatic?) repair failed  
  4.  
  5. 110726 17:24:31 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.  
  6.  
  7. 110726 17:24:31 [ERROR] /usr/local/mysql/libexec/mysqld: Table './mysql/user' is marked as crashed and last (automatic?) repair failed  
  8.  
  9. 110726 17:24:31 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/user' is marked as crashed and last (automatic?) repair failed  
  10.  
  11. 110726 17:24:31 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended  
  12.  
  13. 110726 17:27:13 mysqld_safe Starting mysqld daemon with databases from /var/lib/mysql  
  14.  
  15. 110726 17:27:13 [Warning] '--skip-locking' is deprecated and will be removed in a future release. Please use '--skip-external-locking' instead. 

 

6、又發(fā)現(xiàn)./mysql/user表?yè)p壞。

 

  1. [root@localhost mysql]# myisamchk -of user.MYI  
  2.  
  3. - recovering (with keycache) MyISAM-table 'user.MYI'  
  4.  
  5. Data records: 6 

 

7、表修復(fù)成功,但是還是啟動(dòng)不了服務(wù),繼續(xù)看錯(cuò)誤日志。

 

  1. /usr/local/mysql/libexec/mysqld: Table './mysql/plugin' is marked as crashed and last (automatic?) repair failed  
  2.  
  3. /usr/local/mysql/libexec/mysqld: Table 'plugin' is marked as crashed and last (automatic?) repair failed  
  4.  
  5. 110726 17:27:13 [ERROR] Can't open the mysql.plugin table. Please run mysql_upgrade to create it.  
  6.  
  7. 110726 17:27:13 [ERROR] /usr/local/mysql/libexec/mysqld: Table './mysql/db' is marked as crashed and last (automatic?) repair failed  
  8.  
  9. 110726 17:27:13 [ERROR] Fatal error: Can't open and lock privilege tables: Table './mysql/db' is marked as crashed and last (automatic?) repair failed  
  10.  
  11. 110726 17:27:13 mysqld_safe mysqld from pid file /var/lib/mysql/localhost.localdomain.pid ended 

 

8、最后一個(gè)錯(cuò)誤,是./mysql/db表還沒(méi)有修復(fù)好繼續(xù)修復(fù)./mysql/db表。

9、執(zhí)行下面的命令修復(fù)./mysql/db表:

  1. [root@localhost mysql]# myisamchk -of db.MYI  
  2.  
  3. - recovering (with keycache) MyISAM-table 'db.MYI'  
  4.  
  5. Data records: 0  
  6.  
  7. Data records: 2 

 

10、最后啟動(dòng)mysql服務(wù)。

 

  1. /usr/local/mysql/bin/mysqld_safe & 

 

11、查看服務(wù)是否在運(yùn)行。

 

  1. [root@localhost ~]# netstat -anp | grep mysqld  
  2.  
  3. tcp        0      0   
  4.  
  5. 0.0.0.0:3306                  
  6.  
  7. 0.0.0.0:*                   LISTEN        
  8.  
  9. 4360/mysqld           
  10.  
  11. unix  2      [ ACC ]     STREAM     LISTENING     14172    
  12.  
  13. 4360/mysqld         /tmp/mysql.sock 

 

這時(shí)發(fā)現(xiàn)服務(wù)已運(yùn)行。

12、登錄mysql試試。

 

  1. [root@localhost ~]# mysql -uroot -p123456  
  2.  
  3. Welcome to the MySQL monitor.  Commands end with ; or \g.  
  4.  
  5. Your MySQL connection id is 35  
  6.  
  7. Server version: 5.1.55-log Source distribution  
  8.  
  9. Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.  
  10.  
  11. This software comes with ABSOLUTELY NO WARRANTY. This is free software,  
  12.  
  13. and you are welcome to modify and redistribute it under the GPL v2 license  
  14.  
  15. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.  
  16.  
  17. mysql>  

 

能登錄。

13、在打開(kāi)網(wǎng)頁(yè),已經(jīng)能正常訪問(wèn)。證明MySQL數(shù)據(jù)庫(kù)的數(shù)據(jù)表就修復(fù)成功了。

關(guān)于MySQL數(shù)據(jù)庫(kù)數(shù)據(jù)表?yè)p壞的問(wèn)題就介紹到這里了,如果您有興趣了解更多關(guān)于MySQL數(shù)據(jù)庫(kù)的知識(shí),可以看一下這里的文章:http://database.51cto.com/mysql/,相信一定會(huì)帶給您收獲的!

【編輯推薦】

  1. 用mysqldumpslow分析執(zhí)行較慢的SQL語(yǔ)句
  2. 關(guān)于MySQL事務(wù)的操作示例以及注意事項(xiàng)
  3. 使用MySQL Proxy告終讀寫(xiě)離別的操作實(shí)例
  4. 開(kāi)啟了log-bin的MySQL數(shù)據(jù)庫(kù)如何備份還原
  5. MySQL數(shù)據(jù)庫(kù)安裝過(guò)程中常見(jiàn)錯(cuò)誤的解決方案
責(zé)任編輯:趙鵬 來(lái)源: 網(wǎng)易博客
相關(guān)推薦

2010-06-09 16:55:47

MySQL數(shù)據(jù)表

2011-07-20 17:02:51

Oracle數(shù)據(jù)庫(kù)

2010-05-12 18:35:25

MySQL數(shù)據(jù)表

2017-05-25 10:23:13

數(shù)據(jù)a表b表

2010-06-13 17:35:17

MySQL數(shù)據(jù)表

2011-07-20 13:40:00

SQLite數(shù)據(jù)庫(kù)查詢(xún)數(shù)據(jù)

2010-05-17 17:54:39

MySQL 數(shù)據(jù)庫(kù)

2011-07-20 12:55:17

SQLite數(shù)據(jù)庫(kù)插入數(shù)據(jù)

2010-05-20 14:25:25

2018-02-25 17:30:18

2011-07-20 13:18:01

SQLite數(shù)據(jù)庫(kù)修改和刪除數(shù)據(jù)

2011-07-20 14:57:47

SQLite數(shù)據(jù)庫(kù)ORDER BYGROUP BY

2011-08-18 18:18:05

MySQL數(shù)據(jù)庫(kù)優(yōu)化

2022-12-28 08:17:36

數(shù)據(jù)庫(kù)數(shù)據(jù)導(dǎo)出

2011-07-21 16:28:20

MySQL數(shù)據(jù)庫(kù)帶游標(biāo)的存儲(chǔ)過(guò)程

2011-08-22 16:41:35

MySQL1067進(jìn)程意外終止

2011-08-02 12:46:46

Oracle數(shù)據(jù)表建立索引

2009-06-22 13:50:00

java連接mysql

2021-03-04 14:10:04

Mysql數(shù)據(jù)庫(kù)數(shù)據(jù)表

2010-10-13 11:54:00

MySQL數(shù)據(jù)庫(kù)表
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)