How can I configure Database Synchronization for multiple MySql servers? The following statements are used to synchronize databases on multiple MySql servers for your reference.
Description of configuration statements for synchronizing databases on multiple MySql servers (basic knowledge ):
# Server ID. the ID of each server cannot be set to the same number.
Server-id = 1
# Enable slave database logs for chained Replication
Log-slave-updates
# Whether the slave database is read-only. 0 indicates read/write, and 1 indicates read-only.
Read-only = 1
# Copy only a table
Replicate-do-table = tablename
# Copy only some available table matching characters)
Replicate-wild-do-table = tablename %
# Only copy a database
Replicate-do-db = dbname
# Copy only some databases
Replicte-wild-do-db = dbname %
# Do not copy a table
Replicate-ignore-table = tablename
# Do not copy some tables
Replicate-wild-ignore-table = tablename %
# Do not copy a database
Replicate-ignore-db = dbname
# Ignore when an error occurs. If this is not added, the synchronization process will terminate if any error occurs.
Slave-skip-errors = all
Sync_binlog = 1
# Whether the copied SQL statement is cleared immediately from the relay log. 1 indicates clearing immediately
Relay-log-purge = 1
# Slave server host, used to generate slave database list for show slave hosts
Report-host = hostname
# Master server host address and port used to connect from the slave server to the master server
Master-host = hostname
Master-port = 3306
# Master server database username and password (please grant copy permission (slave ))
Master-user = dbuser
Master-password = password
# Default Retry Interval
Master-connect-retry = 60
# Enable database logs
Log-bin = mysql-bin.log
# Name of the database to be synchronized
Binlog-do-db = dbname
# Name of the database to be synchronized
Binlog-ignore-db = dbname
Obtain the MySql time function of the current time
Mysql Aggregate functions
MySQL string case-sensitive Conversion Function
Use of MySQL concat Functions
Implementation of MySql remote connection