41 lines
725 B
INI
41 lines
725 B
INI
[mysqld]
|
|
# 基本设置
|
|
character-set-server=utf8mb4
|
|
collation-server=utf8mb4_unicode_ci
|
|
default-authentication-plugin=mysql_native_password
|
|
|
|
# 连接设置
|
|
max_connections=1000
|
|
max_connect_errors=100
|
|
max_allowed_packet=64M
|
|
|
|
# 性能优化
|
|
innodb_buffer_pool_size=256M
|
|
innodb_log_file_size=64M
|
|
innodb_flush_log_at_trx_commit=2
|
|
innodb_flush_method=O_DIRECT
|
|
|
|
# 查询缓存
|
|
query_cache_type=0
|
|
query_cache_size=0
|
|
|
|
# 慢查询日志
|
|
slow_query_log=1
|
|
slow_query_log_file=/var/log/mysql/slow.log
|
|
long_query_time=2
|
|
|
|
# 二进制日志
|
|
log_bin=mysql-bin
|
|
binlog_format=ROW
|
|
expire_logs_days=7
|
|
max_binlog_size=100M
|
|
|
|
# 时区设置
|
|
default-time-zone='+08:00'
|
|
|
|
[mysql]
|
|
default-character-set=utf8mb4
|
|
|
|
[client]
|
|
default-character-set=utf8mb4
|