分享、学习、提高
2007/07/09 19:10
本机打了Win2003的SP2,在运行时,突然死机。

重启后,运行PHP程序,原来好好的,突然出现:Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource

看看sql语句,没啥不正确呀。
去phpmyadmin中运行一下,晕,提示:
#126 - Incorrect key file for table '.\mobile\mobile.MYI'; try to repair it

使用其的检查表(CHECK TABLE `mobile`),提示确实有错误,正准备用修复表(REPAIR TABLE `mobile`),突然提示:

#145 - Table '.\mobile\mobile' is marked as crashed and should be repaired

...直接表损坏了:(

网上搜索一下,说是使用这句。

myisamchk -c -r *.MYI


C:\MySQL\data>myisamchk -c -r *.MYI
myisamchk: error: 22 when opening MyISAM-table '*.MYI'

C:\MySQL\bin>myisamchk mobile.MYI
myisamchk: error: File 'mobile.MYI' doesn't exist

想想,可能是它找不到文件吧。
于是
C:\MySQL\data>myisamchk -c -r c:/mysql/data/mobile/mobile.MYI
- recovering (with sort) MyISAM-table 'c:/mysql/data/mobile/mobile.MYI'
Data records: 104424
- Fixing index 1
- Fixing index 2
- Fixing index 3
Data records: 104430

哈,恢复!
发表评论
表情
emotemotemotemotemot
打开HTML
打开UBB
打开表情
隐藏
昵称   密码   游客无需密码
网址   电邮   [注册]