# MySQL Binlog 回滚优化配置
# 用于考培练系统的数据库回滚功能

[mysqld]
# Binlog 配置 - 确保回滚功能可用
log-bin = mysql-bin
binlog_format = ROW
binlog_row_image = FULL
expire_logs_days = 7
max_binlog_size = 100M

# 事务配置 - 支持更好的回滚
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1

# 字符集配置
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

# 性能优化
innodb_buffer_pool_size = 256M
innodb_log_file_size = 64M
innodb_log_buffer_size = 16M

# 连接配置
max_connections = 200
wait_timeout = 28800
interactive_timeout = 28800

# 查询缓存（MySQL 8.0已移除，保留注释）
# query_cache_type = 1
# query_cache_size = 32M

# 慢查询日志
slow_query_log = 1
slow_query_log_file = /var/log/mysql/slow.log
long_query_time = 2

# 错误日志
log-error = /var/log/mysql/error.log

# 二进制日志
log-bin-trust-function-creators = 1

# 时区设置
default-time-zone = '+08:00'
