블로그 이미지
Rootrator
1개를 알면 모르는 10개가 튀어나온다..!

calendar

1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31

Notice

2011. 3. 24. 12:11 Mysql

어느날 홈페이지상에서 테이블이 깨져 복구를 해야 한다는 메세지가 뜬적이 있었다.

myisamchk로 체크 후 복구를 해보자.

[root@localhost bin]# ./myisamchk ../var/깨진DB.MYI
Checking MyISAM file: ../깨진DB.MYI
Data records:     886   Deleted blocks:       0
myisamchk: warning: Table is marked as crashed
myisamchk: warning: 27 clients are using or haven't closed the table properly
- check file-size
- check record delete-chain
- check key delete-chain
- check index reference
- check data record references index: 1
- check data record references index: 2
- check data record references index: 3
- check data record references index: 4
- check data record references index: 5
- check data record references index: 6
- check data record references index: 7
- check data record references index: 8
- check data record references index: 9
- check data record references index: 10
- check data record references index: 11
- check record links
myisamchk: error: Checksum for key:  8 doesn't match checksum for records
MyISAM-table '../var/깨진DB.MYI' is corrupted
Fix it using switch "-r" or "-o"

-r이나 -o 옵션을 주어 복구 하란다.

[root@localhost bin]# ./myisamchk -r ../var/깨진DB.MYI
- recovering (with sort) MyISAM-table '../var/깨진DB.MYI'
Data records: 886
- Fixing index 1
- Fixing index 2
- Fixing index 3
- Fixing index 4
- Fixing index 5
- Fixing index 6
- Fixing index 7
- Fixing index 8
- Fixing index 9
- Fixing index 10
- Fixing index 11

이제 정상적으로 복구가 되었다

반응형
posted by Rootrator