mysql数据库下损坏数据的恢复操作其过程总结(3)
handle a couple of cases where '-r' reports that it
can't fix the data file.
--character-sets-dir=...
Directory where character sets are
--set-character-set=name
Change the character set used by the index
-q, --quick Faster repair by not modifying the data file.
One can give a second '-q' to force myisamchk to
modify the original datafile in case of duplicate keys
-u, --unpack Unpack file packed with myisampack.
Other actions:
-a, --analyze Analyze distribution of keys. Will make some joins in
MySQL faster. You can check the calculated distribution
by using '--description --verbose table_name'.
-d, --description Prints some information about table.
-A, --set-auto-increment[=value]
Force auto_increment to start at this or higher value
If no value is given, then sets the next auto_increment
value to the highest used value for the auto key + 1.
-S, --sort-index Sort index blocks. This speeds up 'read-next' in
applications
-R, --sort-records=#
Sort records according to an index. This makes your
data much more localized and may speed up things
C:\MySQL\bin>myisamchk c:\MySQL\data\hw_enterprice\function_products.frm
myisamchk: error: 'c:\MySQL\data\hw_enterprice\function_products.frm' is not a M
yISAM-table
C:\MySQL\bin>myisamchk c:\MySQL\data\hw_enterprice\function_products.myi
Checking MyISAM file: c:\MySQL\data\hw_enterprice\function_products.myi
Data records: 85207 Deleted blocks: 39
myisamchk: warning: Table is marked as crashed
myisamchk: warning: 1 clients is using or hasn't closed the table properly
- check file-size
- check key delete-chain
- check record delete-chain
myisamchk: error: record delete-link-chain corrupted
- check index reference
- check data record references index: 1
- check data record references index: 2
- check data record references index: 3
- check record links
myisamchk: error: Wrong bytesec: 0-195-171 at linkstart: 841908
MyISAM-table 'c:\MySQL\data\hw_enterprice\function_products.myi' is corrupted
Fix it using switch "-r" or "-o"
继续进行操作:
C:\MySQL\bin>myisamchk --recover --quick c:\MySQL\data\hw_enterprice\function_p
roducts.myi
- check key delete-chain
- check record delete-chain
myisamchk: error: record delete-link-chain corrupted
myisamchk: error: Quick-recover aborted; Run recovery without switch 'q'
Updating MyISAM file: c:\MySQL\data\hw_enterprice\function_products.myi
MyISAM-table 'c:\MySQL\data\hw_enterprice\function_products.myi' is not fixed be
cause of errors
Try fixing it by using the --safe-recover (-o) or the --force (-f) option
系统提示我使用--safe-recover (-o) or the --force (-f) option进行修复操作,于是
C:\MySQL\bin>myisamchk --safe-recover c:\MySQL\data\hw_enterprice\function_prod
ucts.myi
- recovering (with keycache) MyISAM-table 'c:\MySQL\data\hw_enterprice\function_
- 最新评论