Technology

MySQL Optimization

Solution Problem: #1265 Data truncated for column ….

// remove STRICT_TRANS_TABLES, ….. in my.cnf

 

// optimize large DB

max_allowed_packet = 1M
thread_cache_size = 8
myisam-recover-options = BACKUP
log_error = /var/log/mysql/error.log
expire_logs_days = 10
max_binlog_size = 100M
innodb_file_per_table = 1
myisam_sort_buffer_size = 64M
read_rnd_buffer_size = 8M
read_buffer_size = 2M
sort_buffer_size = 2M

## ini rekomendasi dari mysqltunner
#innodb_buffer_pool_size = 4G
#innodb_log_file_size = 1024M
table_open_cache = 4096
join_buffer_size = 256k
query_cache_type = 1
query_cache_limit = 4M
query_cache_size = 128M

slow_query_log = ON
long_query_time = 5
key_buffer_size = 512M
sql_mode=NO_ENGINE_SUBSTITUTION