狀況描述

1、使用 command line 直接執行 mysql client,是可以連線到 mysql 資料庫的

2、在同一個主機的其他網站,是可以正常運作的

判斷

資料庫或資料表可能損毀

解決方式

檢查資料庫

mysqlcheck 資料庫名稱 -u 使用者名稱 -p 

結果發現是 wp_options 這個資料表壞了,先試一下自動修複

mysqlrepair 資料庫名稱 wp_options -u 使用者名稱 -p 

然後系統告訴我沒辦法修

Table './kirinidvtw/wp_options' is marked as crashed and last (automatic?) repair failed when using LOCK TABLES

所以我只好從備份的 sql dump 中,取出 wp_options 的部分,匯入資料庫中

mysql -u 使用者名稱 資料表名稱 -p < wp_options.sql

然後網站就恢復正常了。

Last modified: 2025-10-27

Author

Comments

Write a Reply or Comment

Your email address will not be published.