下面我來給大家總結(jié)一下關(guān)于MYSQL錯誤#145各種解決辦法總結(jié),有碰到MYSQL錯誤#145錯誤的朋友可參考參考.
Mysql有的時候因為掉電或者其他原因?qū)е聰?shù)據(jù)庫損壞,錯誤信息如下:
- MySql: Can't open file: 'sdb_sessions.MYI'. (errno: 145)
- For more information, see Help and Support Center at
我們可以使用mysql自帶的mysqlcheck命令來快速修復(fù)所有的數(shù)據(jù)庫或者特定的數(shù)據(jù),如果你的數(shù)據(jù)庫主機就你一個人用,并且你還能控制的話,建議你用Mysql自帶的修復(fù)工具myisamchk.exe進行修復(fù),操作如下:
修復(fù)前將mysql服務(wù)停止,如果是Win主機,打開命令行方式,然后進入到mysql的/bin目錄,執(zhí)行myisamchk -r 數(shù)據(jù)庫所在路徑*.MYI,如果是類Unix主機,直接使用myisamchk -r 數(shù)據(jù)庫目錄*.MYI.
使用命令myisamchk修復(fù)數(shù)據(jù)庫的MYI文件即可,代碼如下:
- # /usr/local/mysql5/bin/myisamchk -c -r /bak/lib/mysql/yourealcn/biz_user.*
- myisamchk: error: ‘/bak/lib/mysql/yourealcn/biz_user.frm’ is not a
- MyISAM-table
- ———
- myisamchk: error: ‘/bak/lib/mysql/yourealcn/biz_user.MYD’ is not a
- MyISAM-table --Vevb.com
- ———
- - recovering (with sort) MyISAM-table ‘/bak/lib/mysql/yourealcn/biz_user.MYI’
- Data records: 20414
- - Fixing index 1
- - Fixing index 2
- - Fixing
- index 3
- - Fixing index 4
其實還有一個簡單的方法打開你的myphpadmin,選中Can’t open file:后面同名的表,有個下拉菜單“選中項”,選擇“修復(fù)”.
1.進入管理mysql的phpmyadmin
2.在左則選中自己的數(shù)據(jù)庫
3.在右則勾選中錯誤信息中的那個’xxx’表
4.滾動屏幕到下面,有個下拉菜單(With selected:),選擇”Repair table”
修改之后,并沒有發(fā)現(xiàn)有什么數(shù)據(jù)損失,連忙備份了一份數(shù)據(jù)庫到郵件里面,備份還是很重要的.
新聞熱點
疑難解答
圖片精選