[client]
port = 3306
socket = /usr/local/mysql/data/mysql.sock
[mysqld]
port = 3306
socket = /usr/local/mysql/data/mysql.sock
datadir = /usr/local/mysql/data
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 4M
table_open_cache = 4096
sort_buffer_size = 8M
net_buffer_length = 32K
read_buffer_size = 8M
read_rnd_buffer_size = 32M
bulk_insert_buffer_size = 64M
myisam_repair_threads = 1
skip-name-resolve
back_log = 600
max_connections = 2000
max_connect_errors = 4000
open_files_limit = 65535
binlog_cache_size = 4M
max_heap_table_size = 8M
join_buffer_size = 8M
thread_cache_size = 8
query_cache_size = 32M
query_cache_limit = 2M
query_cache_min_res_unit = 2k
ft_min_word_len = 4
thread_stack = 192K
tmp_table_size = 120M
slow_query_log = 1
long_query_time = 1
slow_query_log_file = /data/mysql/data/mysql-slow.log
skip-external-locking
bulk_insert_buffer_size = 8M
interactive_timeout = 28800
wait_timeout = 28800
myisam_sort_buffer_size = 8M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
log-bin=mysql-bin
binlog_format=mixed
server-id = 1
[mysqldump]
quick
max_allowed_packet = 16M
[mysql]
no-auto-rehash
[myisamchk]
key_buffer_size = 256M
sort_buffer_size = 256M
[mysqlhotcopy]
interactive-timeout
不需要重启mysql,使之生效的方法:
set global max_allowed_packet = 167772160;
set global query_cache_limit = 33554432;
set global myisam_sort_buffer_size = 125829120;
set global bulk_insert_buffer_size = 125829120;
set global max_heap_table_size = 314572800;
set global tmp_table_size = 314572800;
转载于:https://blog.51cto.com/xjcf00/1640755