自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

如何修復(fù)崩潰的WordPress數(shù)據(jù)庫表?

譯文
數(shù)據(jù)庫 MySQL
崩潰的原因可能不一樣,但通常當mysqld或mysqld運行在其中的主機在數(shù)據(jù)庫更新過程中被強行關(guān)閉時,就會引發(fā)數(shù)據(jù)庫崩潰。在教程的其余部分,我將介紹如何修復(fù)崩潰的WordPress MySQL數(shù)據(jù)庫表。

【51CTO精選譯文】WordPress數(shù)據(jù)庫可能會在各種情形下遇到故障和損壞。它遇到的常見問題之一就是“數(shù)據(jù)庫崩潰”。如果出現(xiàn)這種情況,你可以在WordPress錯誤日志中找到下列錯誤信息:

 

WordPress database error Table './my_home/wp_posts' is marked as crashed and last (automatic?) repair failed for query SELECT post_date_gmt FROM wp_posts WHERE post_status = 'publish' AND post_type IN ('post', 'page', 'attachment') ORDER BY post_date_gmt DESC LIMIT 1 made by require('wp-blog-header.php'), wp, WP->main, WP->send_headers, get_lastpostmodified, get_lastpostdate, _get_last_post_time

這類數(shù)據(jù)庫表崩潰的癥狀多種多樣。你的WordPress博客可能出現(xiàn)不一樣的異常,這取決于崩潰的是哪個表。如果崩潰的表是里面含有一系列博文的“wp_posts”表,你就看不到博客里面的任何帖子。Xmodulo網(wǎng)站就在上個周末遇到了這種數(shù)據(jù)庫崩潰:

 

Xmodulo的WordPress博客眼下由MySQL運行,所以我在本教程中將著重介紹MySQL。

MySQL表為何會崩潰?

崩潰的原因可能不一樣,但通常當mysqld或mysqld運行在其中的主機在數(shù)據(jù)庫更新過程中被強行關(guān)閉時,就會引發(fā)數(shù)據(jù)庫崩潰。在教程的其余部分,我將介紹如何修復(fù)崩潰的WordPress MySQL數(shù)據(jù)庫表。

***種方法

如果你使用共享的主機托管服務(wù),通??梢栽L問Cpanel,這讓你可以通過Cpanel Web界面修復(fù)數(shù)據(jù)庫。

登錄進入到Cpanel,點擊“Databases”(數(shù)據(jù)庫)部分下面的“MySQL Databases”(MySQL數(shù)據(jù)庫)。

 

在MySQL Databases頁面上,你會在“Modify Databases”(修改數(shù)據(jù)庫)部分下面找到“Repair DB”(修復(fù)數(shù)據(jù)庫)。

 

選擇含有崩潰表的那個數(shù)據(jù)庫,點擊“Repair DB”(修復(fù)數(shù)據(jù)庫)按鈕。如果修復(fù)成功,你會看到每個表的狀態(tài)顯示為“OK”。

 

  1. my_database.wp_oiopub_tracker_visits OK  
  2. my_database.wp_options OK  
  3. my_database.wp_postmeta OK  
  4. my_database.wp_posts  
  5. error : Keyblock size at page 13001728 is not correct. Block length: 532 key length: 2  
  6. Error : Incorrect key file for table './my_database/wp_posts.MYI'; try to repair it  
  7. error : Corrupt  
  8. ---------  
  9. After repair:  
  10. ----  
  11. my_database.wp_oiopub_tracker_visits OK  
  12. my_database.wp_options OK  
  13. my_database.wp_postmeta OK  
  14. my_database.wp_posts OK  
  15. my_database.wp_sharebar OK  
  16. my_database.wp_term_relationships OK 

 

第二種方法

如果你在MySQL服務(wù)器運行在上面的主機(比如VPS)上享用根目錄訪問權(quán),就可以試一試命令行接口,修復(fù)崩潰的數(shù)據(jù)庫表。

就MyISAM類型的數(shù)據(jù)庫而言,你可以使用名為myisamchk的命令行實用工具,修復(fù)崩潰的表。該實用工具隨MySQL服務(wù)器一同安裝。

首先,停止MySQL服務(wù)器。

  1. $ sudo service mysql stop (Debian/Ubuntu)  
  2. $ sudo service mysqld stop (CentOS/RHEL)  
  3. $ sudo systemctl stop mysqld.service (Fedora) 

然后使用這個命令修復(fù)某一個表。

  1. $ cd /var/lib/  
  2. $ sudo myisamchk -r -v -f mysql/<database_name>/<table_name> 

***,再次啟動MySQL服務(wù)器。

你平時有沒有遇到過數(shù)據(jù)庫崩潰問題,或者是WordPress數(shù)據(jù)庫出現(xiàn)的其他任何問題?你是否定期備份自己的WordPress數(shù)據(jù)庫表?歡迎告訴我們你用什么方法來解決這個問題、維護數(shù)據(jù)庫。
 

英文:http://xmodulo.com/2014/06/repair-crashed-wordpress-database-table.html

責(zé)任編輯:林師授 來源: 51CTO
相關(guān)推薦

2009-02-02 13:16:23

修復(fù)數(shù)據(jù)表MySQL

2011-03-15 09:55:07

SQL Server2數(shù)據(jù)庫崩潰還原數(shù)據(jù)庫

2022-06-06 08:21:13

MySQL數(shù)據(jù)庫命令

2011-03-15 09:52:40

SQL Server2數(shù)據(jù)庫恢復(fù)系統(tǒng)

2018-03-05 19:20:49

LinuxWordPressHTTP

2011-05-18 13:16:21

MySQL數(shù)據(jù)庫鎖定

2023-09-14 23:05:57

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

2011-04-12 09:43:17

Sybase數(shù)據(jù)庫修復(fù)技巧

2010-07-21 17:31:19

SQL Server

2010-10-13 11:54:00

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

2009-06-11 13:16:57

JBPM數(shù)據(jù)庫

2009-02-02 16:50:34

數(shù)據(jù)庫表的鎖定MySQL

2017-05-03 13:50:38

2011-03-24 16:23:18

sql2005數(shù)據(jù)庫

2019-10-21 08:08:34

MySQL數(shù)據(jù)庫主鍵

2010-06-07 13:53:04

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

2009-02-02 13:43:19

故障檢測數(shù)據(jù)庫

2010-05-24 14:38:41

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

2011-07-19 11:12:36

PHPMySQL數(shù)據(jù)庫

2009-07-06 23:23:15

Sybase數(shù)據(jù)庫修復(fù)
點贊
收藏

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