커피향이 나는 *NIX
커피닉스
시스템/네트웍/보안을 다루는 곳
*
HanIRC의 #coffeenix 방
[
장비 및 회선 후원
]
> Forum <
IT 일정
N
e
w
!
자동화 프로젝트
HOME
>
데이터베이스(database)
>
MySQL
도움말
검색 :
사이트
WHOIS
웹서버 종류
Mysql DB 깨졌을때 살리는법 (myisamchk) (글 chongnux)
작성일 : 2003/10/18 21:48
글쓴이 : 좋은진호 (
http://coffeenix.net/
)
조회수 : 7665
[
이전화면
/
수정
] 비밀번호 :
출처 : KLDP BBS,
http://bbs.kldp.org/viewtopic.php?t=25981
--------------------------------------------------------------
글쓴이 : chongnux
올려짐: 2003년10월13일 14:10 주제: Mysql DB 가 깨졌을때 살리는법 (myisamchk)
어느날 아침 로긴이 안되거나 혹은 게시판에서 데이터 베이스 엑세스를 할수 없습니다.. 이런 메세지를 볼수 있다. 난감하기 그지 없다... 어떻게 극복을 할것인가... ?
데이터 베이스는 항상 깨지기 마련이다. 1년은 운영한다면.. 적어도 1~2회 정도는 화일을 열수 없습니다.
에러 메세지 :
ERROR 1016: Can't open file: 'xxxxxx.MYD'. (errno: 145)
만약 /usr/local/mysql/var/데이터 베이스에 들어 가면 각각의 부분에 대하여
*.FRM : 테이블 정보
*.MYI : 인덱스 정보
*.MYD : 데이타 정보
[root@ilinuxbay ]# /usr/local/mysql/bin/myisamchk sessions.*
myisamchk: error: 'sessions.MYD' is not a MyISAM-table
---------
Checking MyISAM file: sessions.MYI
Data records: 6 Deleted blocks: 6
myisamchk: warning: Table is marked as crashed
- check file-size
- check key delete-chain
- check record delete-chain
myisamchk: warning: Not used space is supposed to be: 896 but is: 624
myisamchk: error: record delete-link-chain corrupted
- check index reference
- check data record references index: 1
myisamchk: error: Found 4 keys of 6
- check record links
myisamchk: error: Record-count is not ok; is 4 Should be: 6
myisamchk: warning: Found 4 deleted blocks Should be: 6
myisamchk: warning: Found 8 parts Should be: 11 parts
MyISAM-table 'sessions.MYI' is corrupted
Fix it using switch "-r" or "-o"
---------
누가 지웠나.. 혹은 화일이 없는 경우 다음과 같은 명령어를 이용 확인 복구를 할 수 있다.
]#myisamchk 옵션을 보면
# -r -o로 복구가 안되면다 -f 옵션을 이용한다.
-f, --force Overwrite old temporary files.
#복구
-r, --recover Can fix almost anything except unique keys that aren't unique.
#안전하게 복구
-o, --safe-recover Uses old recovery method; Slower than '-r' but can
handle a couple of cases where '-r' reports that it
can't fix the data file.
#데이터 정렬 및 속도 증가 -R1 저도 주면 될듯 싶네요
-R, --sort-records=#
Sort records according to an index. This makes your
data much more localized and may speed up things
일반적으로 -r 을 기본으로 사용하며 대상 화일은 * 확장자를 잡으면 된다.
그럼 복구를 해보자.
[root@ilinuxbay ]# /usr/local/mysql/bin/myisamchk -r sessions.*
myisamchk: error: 'sessions.MYD' is not a MyISAM-table
---------
- recovering (with sort) MyISAM-table 'sessions.MYI'
Data records: 6
- Fixing index 1
Data records: 4
---------
혹 구버전인 경우 isamchk 명령어를 이용 복구 가능합니다. 가능한 데이터베이스를 정지하고 하세요.
그럼.. 무운을 빕니다. 전 복구 했어요.
커피닉스 카페 최근 글
[06/16]
[질문]SAN 스위치 브로드케이드 dcx8510-4 장비관련입니다.
[04/22]
Re: 영화속에 컴퓨터 이야기 ~스워드피쉬(2001)
[10/20]
Cross Compiler 깔
[07/14]
SSL АО
[04/26]
Re: 도스화면 원격조종 여부
[04/25]
도스화면 원격조종 여부
[10/30]
Cshell에서 난수 설정
[10/23]
공항철도주식회사 SE 구인 件
[01/26]
Re: wget으로 다른서버에있는 디렉토리를 가져오려고합니다.
[01/25]
wget으로 다른서버에있는 디렉토리를 가져오려고합니다.
[01/11]
특정 안드로이드 WebView 버전에서 SSL 문제 (WebView 버그)
[08/01]
DNS forwarder (전달자) 서버를 통해서 쿼리하면 역방향을 받아오질 못합니다.
[05/16]
(주)후이즈 시스템엔지니어 (경력자) 모집
[02/15]
[AWS] Cloudfront edge 확인하기
[01/20]
Mobile Service/eCommerce 기업에서 Server / Java / PHP 개발자 구인
N
e
w
! 최근에 등록한 페이지
KiCad EDA Suite project (Free/Libre/Open-Source EDA Suite) (CAD)
오픈캐스케이드 캐드 (OpenCASCADE CAD)
QCad for Windows --- GNU GPL (Free Software)
The Hello World Collection
IPMI를 활용한 리눅스 서버관리
DNS 설정 검사
nagiosgraph 설치 방법
Slony-I 설치 방법 (postgresql replication tool)
Qmail기반의 Anti spam 시스템 구축하기
clusterssh
[ 함께하는 사이트 ]
운영진 :
좋은진호(truefeel)
, 야수(yasu), 범냉이, sCag
2003년 8월 4일~