Mysql 5.7.38 32G服务器生产环境配置

[mysqld]

sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

transaction_isolation=READ-COMMITTED

datadir=/data/mysql

pid_file=/opt/mysql/mysqld.pid

socket=/opt/mysql/mysql.sock

user=mysql

port=3306

character_set_server= utf8

default_storage_engine = InnoDB

bind_address = 0.0.0.0

log_timestamps=SYSTEM

secure_file_priv =

lower_case_table_names=1

#cluster

server-id=2

auto-increment-offset=1

auto-increment-increment=2

gtid_mode=on

enforce_gtid_consistency=on

#binlog

log_bin=/data/binlog/mysql-bin

binlog_format=ROW

expire_logs_days=7

#relaylog

relay-log=/data/relaylog/relay-bin

#read-only=on

#log

log_error='/data/log/mysql.log'

slow_query_log=on

slow_query_log_file='/data/log/slow.log'

#general_log = 1

general_log_file = /data/log/general.log

#connect

max_connect_errors=100000

max_connections = 3000

max_allowed_packet = 20M

#interactive_timeout = 1800

#wait_timeout = 1800

open_files_limit = 20000

#cache

tmp_table_size = 64M

max_heap_table_size = 64M

thread_cache_size = 256

table_definition_cache =4096

table_open_cache = 4096

sort_buffer_size = 1M

read_buffer_size = 1M

read_rnd_buffer_size = 1M

join_buffer_size = 1M

thread_stack = 512K

#innodb

innodb_flush_log_at_trx_commit =2

innodb_buffer_pool_size = 24G

innodb_buffer_pool_instances = 4

innodb_read_io_threads = 4

innodb_write_io_threads = 26

innodb_io_capacity = 300

innodb_use_native_aio = on

innodb_log_file_size = 512M

[mysqld_safe]

log-error =/data/mysql/mysql_err.log

pid-file =/data/mysql/mysqld.pid

[mysql]

auto-rehash

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值