hoangweb
4/16/2016 - 1:07 PM

/etc/mysql/my.cnf

/etc/mysql/my.cnf

[mysqld]
skip-name-resolve
user    	= mysql
port    	= 3306
datadir    	= /var/lib/mysql

myisam_use_mmap=1
max_connections=100
max_user_connections = 50

# log
log-slow-queries=mysql-slow.log

long_query_time = 0.1
safe-show-database
query_cache_type = 1
query_cache_size = 75M
query_cache_limit = 2M

join_buffer_size=1M
read_rnd_buffer_size=1M
max_allowed_packet = 10M

tmp_table_size=25M
max_heap_table_size=25M

table_open_cache = 7500
thread_cache_size = 25

open_files_limit=30000

key_buffer_size = 500M
myisam_sort_buffer_size = 256M

open-files-limit = 2048
table_cache            = 512    #value is 64, so 512 should be a safe bet to begin with.

bind-address    = 127.0.0.1

# each table, including its indexes, is stored as a separate file ibdata*
innodb_file_per_table=1
innodb_buffer_pool_size = 1G
innodb_log_file_size = 64M
innodb_log_buffer_size = 8M


[mysql]
# Configure default options for clients
port = 3306

###################
#remoe old log files 
#rm -rf /var/lib/mysql/ib_logfile*
#restart mysql
#service mysql restart