MySQL錯誤修復:Table xx is marked as crashed and last (automatic?) repair failed
問題一 Table xx is marked as crashed and last (automatic?) repair failed
有開發找到我,說資料庫壞了,連不上資料庫,看了下 MySQL 的錯誤日誌,報錯如下:
Error: Table './db_name/table_name' is marked as crashed and last (automatic?) repair failed
修復
1、先停止 MySQL:service mysqld stop
2、進入到 MySQL 資料庫的檔案存放目錄,比如 cd /data/mysql_data/xx_db
然後執行如下命令:
myisamchk --safe-recover -f -r *.MYI
執行完成後,為了保險起見,我們要將檔案的許可權改回 MySQL 的執行賬號(自行檢視),比如 mysql:
chown -R mysql:mysql .
3、啟動 MySQL:service mysqld start
4、最後,執行再次自動修復優化命令即可解決:
mysqlcheck --auto-repair --optimize --all-databases -p密碼
問題二 /usr/local/mysql/bin/mysqld does not exist or is not executable.
]# /data/wapage/hhzk/mserver/mysql5713/bin/mysqld_safe --defaults-file=/etc/my.cnf &
[1] 24527
]# 2020-11-23T10:36:45.803151Z mysqld_safe Logging to '/data/wapage/hhzk/mserver/mysql5713/data/qd01-tech2-rec-build001.ps.easou.com.err'.
2020-11-23T10:36:45.809116Z mysqld_safe The file /usr/local/mysql/bin/mysqld
does not exist or is not executable. Please cd to the mysql installation
directory and restart this script from there as follows:
./bin/mysqld_safe&
See http://dev.mysql.com/doc/mysql/en/mysqld-safe.html for more information
[1]+ Exit 1 /data/wapage/hhzk/mserver/mysql5713/bin/mysqld_safe --defaults-file=/etc/my.cnf
說明:mysqld_safe啟動指令碼預設的從/usr/local/mysql目錄中讀取另外一個啟動指令碼mysqld,因為我的安裝目錄為/data/wapage/hhzk/mserver/mysql5713。所以找不到相關檔案。可以從兩個方面解決。
修復
方法一:在/usr/local/mysql建立連結檔案
mkdir -p /usr/local/mysql/bin
ln -s /data/wapage/hhzk/mserver/mysql5713/bin/mysqld /usr/local/mysql/bin/mysqld
方法二:將mysqld_safe中的所有/usr/local/mysql目錄改為自己實際的安裝目錄
sed -i 's#/usr/local/mysql#/data/wapage/hhzk/mserver/mysql5713#g' /data/wapage/hhzk/mserver/mysql5713/bin/mysqld_safe
相關文章
- Table '.\mysql\proc' is marked as crashed and should be repaired 報錯MySqlAI
- MySQL資料庫出錯:Table ... is marked as crashed and should be repairedMySql資料庫AI
- [ERROR]XX is marked as crashed and should be repairedErrorAI
- mysqld: Table '.mac_vod' is marked as crashed and should be repairedMySqlMacAI
- 資料庫 Table is marked as crashed and should be repaired 解決辦法資料庫AI
- PostgreSQL cache lookup failed for type XXXX 錯誤SQLAI
- mysql Incorrect key file for table ‘/xxxxxxxx/xxxx.MYI'; try to repair itMySqlAI
- NetworkError: Failed to execute 'send' on 'XMLHttpRequest': Failed to load xxxx錯誤解決方法ErrorAIXMLHTTP
- MySQL GTID複製錯誤修復演示MySql
- Linux環境下MySQL報Table 'xxx' doesn't exist錯誤解決方法LinuxMySql
- 利用mysql slave 修復master MyISAM tableMySqlAST
- 【Mysql】mysql同步錯誤:Last_Errno: 1677MySqlAST
- 啟動IDEA 報 failed to load jvm dll XXX 錯誤IdeaAIJVM
- SVN chechout failed: xxx is not valid as filename in directory svn檢出錯誤AI
- Oracle 11g ADG Automatic Block Repair(ABMR自動塊修復)功能測試OracleBloCAI
- DBMS_REPAIR修復壞塊AI
- 11g DataGuard通過ABMR自動修復主庫壞塊 - Automatic Block Media RepairBloCAI
- Ubuntu 更新錯誤修復大全Ubuntu
- 如何修復 HTTP 505 錯誤?HTTP
- msck repair命令 修復表分割槽AI
- beego報錯 table name: `xxx` not existsGo
- nmap報錯: Failed to open device ethxxxAIdev
- tenorshare video repair(影片修復工具)IDEAI
- 使用dbms_repair修復塊損壞AI
- 如何修復HTTP 301錯誤?HTTP
- 如何修復代理400錯誤請求?
- 如何修復那些奇怪的 JavaScript 錯誤JavaScript
- Vetur報錯:The Vue Language Server server crashed 5 times in the last 3 minutes.VueServerAST
- win10系統lsp錯誤怎樣修復_win10修復lsp錯誤的步驟Win10
- 修改MySQL資料型別報 Changing columns for table XXX 錯的問題MySql資料型別
- MySQL 5.6修復從庫複製時報錯'ERROR 1872 (HY000): Slave failed to initialize'MySqlErrorAI
- Vue packages version conflicts 錯誤修復VuePackage
- Checkpoint log:invalid bitmap page錯誤修復
- 如何修復HTTP 302錯誤呢?HTTP
- http代理401錯誤修復步驟HTTP
- 如何修復http代理406錯誤呢?HTTP
- iOS System Repair:(IOS系統修復工具)下載iOSAI
- linux下repair filesystem模式修復方法實踐LinuxAI模式