Posted
Filed under Mysql
mysqlcheck 유틸리티 사용법(analyze, optimize, repair)

mysqlcheck 유틸리티 사용법

cost 베이스 DB에서 DB전체를 한번에 analyze, optimize, repair 하기 위한 유틸리티 입니다.
파일위치 : mysql/bin
----------------------------------------------------
전체 체크 및 자동 복구(check and repair)
mysqlcheck -Aa --auto-repair -u root -p
mysqlcheck -Ao --auto-repair -u root -p
----------------------------------------------------
-A, --all-databases
-a, --analyze
-o, --optimize
-P 포트번호
----------------------------------------------------
특정 데이터베이스만 체크 및 자동 복구
mysqlcheck --auto-repair -u root -p 데이터베이스명
----------------------------------------------------
특정 테이블만 체크 및 자동 복구
mysqlcheck --auto-repair -u root -p 데이터베이스명 테이블명
----------------------------------------------------
명령어 수정하여 사용하기
mysqlrepair = mysqlcheck --repair
mysqlanalyze = mysqlcheck --analyze
mysqloptimize = mysqlcheck --optimize
----------------------------------------------------
mysql에 접속하여 개별적으로 하는 방법
mysql> use 데이터베이스명;
mysql> show tables;
mysql> check table 테이블명;
mysql> repair table 테이블명;
mysql> analyze table 테이블명;
mysql> optimize table 테이블명;
----------------------------------------------------
##########################
OPTIMIZED table script PHP
##########################
$db = 'database_name';
$tables = mysql_list_tables($db);
while (list($table)name) = mysql_fetch_array($tables)) {
$sql = "OPTIMIZE TABLE $table_name";
mysql_query($sql) or exit(mysql_error());
}
2018/03/31 13:10 2018/03/31 13:10

blog.visualp.com

cash for cars sunshi

This is a very useful post, thank you! I agree that innovations are the most important thing for most businesses because with today’s fast-changing world we need to stay on top of the changes if we want to survive.

cash for cars cabool

This is a very useful post, thank you! I agree that innovations are the most important thing for most businesses because with today’s fast-changing world we need to stay on top of the changes if we want to survive.

Car Wreckers

Excellently written article, if only all blogger offered the same level of content as you, the internet would be a much better place. Please keep it up!.Great tips, I would like to join your blog anyway.Waiting for some more review.Thank you