mysql 데이터 파일 체크하기 정보
MySQL mysql 데이터 파일 체크하기
본문
아래와 같이 쉘스크립트 생성후 실행합니다 경로는 환경에 맞게 수정하세요
#!/bin/sh
if [ -z $1 ]; then
echo "usage: $0 DB_NAME"
exit 1
fi
FILES=`ls /usr/local/mysql/data/$1/*{ISM,MYI} 2> /dev/null`
for target_file in $FILES; do
if [ "X${target_file##*.}" = "XISM" ]; then
chktool="isamchk"
else
chktool="myisamchk"
fi
/usr/local/mysql/bin/$chktool --recover $target_file
echo "$target_file ok"
done
exit 0
이상입니다<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
#!/bin/sh
if [ -z $1 ]; then
echo "usage: $0 DB_NAME"
exit 1
fi
FILES=`ls /usr/local/mysql/data/$1/*{ISM,MYI} 2> /dev/null`
for target_file in $FILES; do
if [ "X${target_file##*.}" = "XISM" ]; then
chktool="isamchk"
else
chktool="myisamchk"
fi
/usr/local/mysql/bin/$chktool --recover $target_file
echo "$target_file ok"
done
exit 0
이상입니다<div class='small'>[이 게시물은 관리자님에 의해 2011-10-31 17:32:05 Linux에서 이동 됨]</div>
추천
6
6
댓글 1개
감사요