Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
| mysql_backups_using_replication [13.11.2025 08:24] – [Backup and Monitoring] Pascal Suter | mysql_backups_using_replication [13.11.2025 08:56] (current) – Pascal Suter | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| in my case i had a docker-compose.yml which contains the php web app and a mysql server service. i first copied the service in the '' | in my case i had a docker-compose.yml which contains the php web app and a mysql server service. i first copied the service in the '' | ||
| - | < | + | < |
| mysql: | mysql: | ||
| # image: mysql:8.0 | # image: mysql:8.0 | ||
| Line 40: | Line 40: | ||
| for the primary server, make sure the config contains the following settings: | for the primary server, make sure the config contains the following settings: | ||
| - | < | + | < |
| [mysqld] | [mysqld] | ||
| server-id = 1 | server-id = 1 | ||
| Line 58: | Line 58: | ||
| and on the replica the settings should look like this: | and on the replica the settings should look like this: | ||
| - | < | + | < |
| [mysqld] | [mysqld] | ||
| server-id = 2 | server-id = 2 | ||
| Line 64: | Line 64: | ||
| relay_log = relay-bin | relay_log = relay-bin | ||
| - | # keep binlog | + | # disable binary logging as we don't need this on the replica |
| - | log_bin = mysql-bin | + | skip-log-bin |
| - | binlog_format = ROW | + | |
| + | # GTID functionality is needed for replication | ||
| gtid_mode = ON | gtid_mode = ON | ||
| enforce_gtid_consistency = ON | enforce_gtid_consistency = ON | ||
| - | log_slave_updates = ON | ||
| # make it read-only for safety | # make it read-only for safety | ||
| Line 77: | Line 76: | ||
| # don't auto-start replication until we finish setup | # don't auto-start replication until we finish setup | ||
| + | # then comment this out | ||
| skip_slave_start = ON | skip_slave_start = ON | ||
| </ | </ | ||