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
Posted
Filed under Linux
Redis can’t set maximum open files to 10064 because of OS error: Operation not permitted.,
Redis can't set maximum open files to 10064 because of OS error: Operation not permitted.
Increased maximum number of open files to 10032 (it was originally set to 1024).

[cenos7]
ulimit -n 32768

change maximum number of open files  1024 to 32768

[참조]
http://myblog.opendocs.co.kr/archives/tag/redis-cant-set-maximum-open-files-to-10064-because-of-os-error-operation-not-permitted
2018/03/30 21:25 2018/03/30 21:25