본문 바로가기

Mysql

my.cnf

mysql my.cnf 튜닝 관련 게시물

my.cnf 기본 예제

# my-huge.cnf MySQL 전용으로 메모리가 1-2G 일 경우
# my-large.cnf MySQL 전용으로 메모리가 512 이상일 경우
# my-medium.cnf MySQL 전용으로 메모리가 32-64M 정도일 경우나
# 메모리가 128 이상이면서 다른 데몬과 같이 서비스 될 경우
# my-small.cnf MySQL 전용으로 메모리가 64M 이하일 경우 

옵션들 문서


기본설정

#mysql db 디렉토리설정
datadir=/var/lib/mysql
#socket 위치설정
socket=/wdb/mysql/mysql.sock
#mysql 구동 userid 설정
user=mysql
#password() 함수 사용시 old_passwords 사용하도록
old_passwords=1
# CPU * 2 로 thread_concurrency 설정
thread_concurrency = 8

메모리 사용 설정

# - mysql-huge.cnf 설정
key_buffer = 384M
max_allowed_packet = 1M
table_cache = 512
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 8M
myisam_sort_buffer_size = 64M
thread_cache_size = 8
query_cache_size = 32M

log-bin관련

#mysql-bin.?????? 파일이 쌓이도록
log-bin=mysql-bin
#특정 데이터베이스 제외시키려면
binlog-ignore-db=somedatabase
#query time 2초 이상인 slow query를 모아볼려면
log_query_time = 2
log-slow-queries = /var/lib/mysql/slowqueries.log
#bdb와 innodb 로그남지 않도록
skip-bdb
skip-innodb

character-set 설정

#utf-8로 설정하는 예제(sitehis.com의 경우)
init_connect=SET collation_connection = utf8_general_ci
init_connect=SET NAMES utf8
default-character-set=utf8
character-set-server=utf8
collation-server=utf8_general_ci
 

FULLTEXT 검색관련

# 2자 이상의 단어에 대해서 fulltext 검색하도록 (sitehis.com의 경우)
ft_min_word_len=2
 

보안관련

# LOAD DATA LOCAL INFILE command 못하게
set-variable=local-infile=0
 

기타

~/.mysql_history 저장안되고
cat /dev/null > ~/.mysql_history 

 

 

'Mysql' 카테고리의 다른 글

mysql 백업 및 복구  (0) 2015.10.07
my sql 초기 비밀번호 설정  (0) 2015.05.20
my.cnf 설정 팁  (0) 2015.04.15
my.cnf 설정 팁  (0) 2015.04.06
ms-sql 권한 부여  (0) 2015.04.03