MySQL5.6的my.ini配置


下面這個配置在現網服務器上跑了兩年了,里面多項參數都有調整過,這個算是最終的一個配置,這個配置不一定適合每種項目,僅供參考。

 

如果MySQL出現異常:Out of memory

需要修改這幾個參數:

sort_buffer_size

read_buffer_size

read_rnd_buffer_size

join_buffer_size

max_connections

具體修改方式:http://aigo.iteye.com/blog/2157766

 

注意:以下配置的服務器硬件是:8核16G內存 

 

 

[client]

 

port=3306

 

[mysql]

 

default-character-set=utf8

 

 

[mysqld]

 

port=3306

 

basedir=D:/mysql-5.6.21-winx64

 

datadir=D:/mysql-5.6.21-winx64/data

 

character-set-server=utf8

 

default-storage-engine=INNODB

 

sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"

 

max_connections=300

query_cache_size=186M

table_open_cache=1520

tmp_table_size=67M

thread_cache_size=38

myisam_max_sort_file_size=100G

myisam_sort_buffer_size=67M

key_buffer_size=290M

read_buffer_size = 1M

read_rnd_buffer_size = 8M

sort_buffer_size = 1M

innodb_additional_mem_pool_size=80M

innodb_flush_log_at_trx_commit=0

innodb_log_buffer_size=8M

innodb_buffer_pool_size=2G

innodb_log_file_size=1024M

innodb_thread_concurrency=18

innodb_support_xa = 1

innodb_file_per_table = 1

innodb_file_format = Barracuda

#interactive_timeout = 2147482

#wait_timeout = 2147482

interactive_timeout = 86400

wait_timeout = 86400

max_allowed_packet = 1G

 

# binlog

log_bin = D:/mysql-5.6.21-winx64/log/binlog/mysql-bin.log

log_bin_index = D:/mysql-5.6.21-winx64/log/binlog/mysql-bin.index

log_error = D:/mysql-5.6.21-winx64/log/mysql-error.log

sync_binlog = 1

expire_logs_days = 7

binlog_format = MIXED

 

[mysqldump]  

max_allowed_packet = 1G


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM