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
相關文章
- mysqld: Table '.mac_vod' is marked as crashed and should be repairedMySqlMacAI
- 資料庫 Table is marked as crashed and should be repaired 解決辦法資料庫AI
- MySQL GTID複製錯誤修復演示MySql
- tenorshare video repair(影片修復工具)IDEAI
- 如何修復 HTTP 505 錯誤?HTTP
- 如何修復HTTP 301錯誤?HTTP
- Vetur報錯:The Vue Language Server server crashed 5 times in the last 3 minutes.VueServerAST
- Vue packages version conflicts 錯誤修復VuePackage
- 如何修復HTTP 302錯誤呢?HTTP
- Oracle 11g DG新特性--Automatic block repairOracleBloCAI
- Checkpoint log:invalid bitmap page錯誤修復
- 如何修復http代理406錯誤呢?HTTP
- 如何修復代理400錯誤請求?
- http代理401錯誤修復步驟HTTP
- win10系統lsp錯誤怎樣修復_win10修復lsp錯誤的步驟Win10
- MYSQL報1022錯誤:Can't write;duplicate key in table '.....'MySql
- iOS System Repair:(IOS系統修復工具)下載iOSAI
- 如何掃描和修復 Linux 磁碟錯誤Linux
- Elasticsearch報Call to undefined xx makeAllSearchable()錯誤ElasticsearchUndefined
- Installation failed with message INSTALL_FAILED_USER_RESTRICTED錯誤AIREST
- eclipse中maven專案failonmissingwebxml錯誤的修復EclipseMavenAIWebXML
- 如何修復http代理出現的503錯誤?HTTP
- 修復HTTP代理501未實現錯誤方法HTTP
- MySQL主從複製Last_SQL_Errno錯誤程式碼彙總說明MySqlAST
- Mac如何修復“無法解除安裝磁碟”錯誤Mac
- Go 自定義日期時間格式解析解決方案 - 解決 `parsing time xx as xx: cannot parse xx as xx` 錯誤Go
- win10驅動器錯誤修復不好怎麼處理_win10驅動器錯誤修復不好解決方法Win10
- 爬蟲代理ip出現401錯誤原因是什麼?如何修復錯誤?爬蟲
- [20220610][轉載]Is my table marked for archive.txtHive
- Angular 錯誤訊息:ERROR Error NullInjectorError No provider for XXAngularErrorNullIDE
- 【Redis】錯誤:failed: Hostname must not be empty or nullRedisAINull
- Github錯誤之failed to push some refs toGithubAI
- PostgreSQL cache lookup failed for type XXXX 錯誤SQLAI
- PG: Estimate last modified or read time of a tableAST
- MySQL執行語句報Incorrect key file for table '/tmp/#sql_.MYI'; try to repair itMySqlAI
- ORACLE登入出現“ORA-12560:TNS:協議介面卡錯誤”錯誤修復Oracle協議
- 如何修復http代理504閘道器超時錯誤HTTP
- HTTP代理504閘道器超時錯誤如何修復?HTTP