MySQL5.6基本优化配置

时间:2021-05-23

"STRICT_TRANS_TABLES,
ERROR_FOR_DIVISION_BY_ZERO,
NO_AUTO_CREATE_USER,
NO_AUTO_VALUE_ON_ZERO,
NO_ENGINE_SUBSTITUTION,
NO_ZERO_DATE,
NO_ZERO_IN_DATE,
ONLY_FULL_GROUP_BY"
skip-name_resolve
max-connect-errors=100000
max-connections=500

# Unique to this machine
server-id=123

到最后了,小编为大家分享一个配置测试不错的适合高配高负载的服务器

[client]
port = 3306
socket = /tmp/mysql.sock
default-character-set = utf8
#设置客户端的字符编码
[mysqld]
# generic configuration options
port = 3306
socket = /tmp/mysql.sock
basedir="d:/database/mysql/"
datadir="d:/database/mysql/data/"
tmpdir = "d:/database/mysql/tmp/"
#*** char set ***
character-set-server = utf8
#设置服务器端的字符编码

#下面三个参数12500,1400,2000
performance_schema_max_table_instances = 12500
table_definition_cache = 1400
table_open_cache = 2000

#*** network ***
back_log = 1024
#skip-networking #默认没有开启
max_connections = 10000
#max_connect_errors = 3000
table_open_cache = 4096
#external-locking #默认没有开启
max_allowed_packet = 256M
max_heap_table_size = 128M

#*** timeout ***
interactive_timeout=1000
wait_timeout=1000

# *** global cache ***
read_buffer_size = 8M
read_rnd_buffer_size = 64M
sort_buffer_size = 16M
join_buffer_size = 1024M

# *** thread ***
thread_cache_size = 64
# thread_concurrency = 8
thread_stack = 512K

# *** query cache ***
query_cache_size = 128M
query_cache_limit = 8M

# *** index ***
ft_min_word_len = 8

#memlock #默认没有开启
default-storage-engine=MYISAM
innodb=OFF
default-tmp-storage-engine=MYISAM
transaction_isolation = REPEATABLE-READ

# *** tmp table ***
tmp_table_size = 1024M

# *** bin log ***
#log-bin=mysql-bin
binlog_cache_size = 4M
binlog_format=mixed
#log_slave_updates #默认没有开启
#log #默认没有开启,此处是查询日志,开启会影响服务器性能
log_warnings #开启警告日志

# *** slow query log ***
slow_query_log
long_query_time = 10
# *** Replication related settings
#server-id = 1
#server-id = 2
#master-host = <hostname>
#master-user = <username>
#master-password = <password>
#master-port = <port>
#read_only
#*** MyISAM Specific options
#myisam_recover
key_buffer_size = 2048M
bulk_insert_buffer_size = 128M
myisam_sort_buffer_size = 128M
myisam_max_sort_file_size = 10G
myisam_repair_threads = 1
myisam_recover_options=force,backup

# *** INNODB Specific options ***
#skip-innodb #默认没有开启
loose-innodb-trx=0
loose-innodb-locks=0
loose-innodb-lock-waits=0
loose-innodb-cmp=0
loose-innodb-cmp-per-index=0
loose-innodb-cmp-per-index-reset=0
loose-innodb-cmp-reset=0
loose-innodb-cmpmem=0
loose-innodb-cmpmem-reset=0
loose-innodb-buffer-p

声明:本页内容来源网络,仅供用户参考;我单位不保证亦不表示资料全面及准确无误,也不保证亦不表示这些资料为最新信息,如因任何原因,本网内容或者用户因倚赖本网内容造成任何损失或损害,我单位将不会负任何法律责任。如涉及版权问题,请提交至online#300.cn邮箱联系删除。

相关文章