MySQL 8主从复制my.cnf文件内容
时间: 2024-06-10 11:03:58 浏览: 284
我可以为您提供MySQL 8主从复制my.cnf文件的模板内容,您可以按照自己的需求进行修改:
# For advice on how to change settings please see
# http://dev.mysql.com/doc/refman/8.0/en/server-configuration-defaults.html
[mysqld]
# General replication settings
log_bin = mysql-bin
binlog_format = ROW
server_id = 1
# Specific master/slave replication settings
relay_log = mysqld-relay-bin
relay_log_recovery = ON
master_info_repository = TABLE
relay_log_info_repository = TABLE
gtid_mode = ON
enforce_gtid_consistency = ON
# InnoDB settings
innodb_flush_log_at_trx_commit = 1
sync_binlog = 1
[client]
port = 3306
socket = /var/run/mysqld/mysqld.sock
[mysqld_safe]
pid-file = /var/run/mysqld/mysqld.pid
socket = /var/run/mysqld/mysqld.sock
nice = 0
log_error = /var/log/mysql/error.log
# If the following two settins are enabled, replication will be slower,
# but if you have highly concurrent, highly update-heavy workloads, you
# may get better performance with these settings enabled.
#skip-innodb_doublewrite
#innodb_flush_neighbors
阅读全文