Skip to content

Commit

Permalink
DBZ-8655 Turn on replication during db initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
vjuranek committed Feb 3, 2025
1 parent 16f7cce commit 0525d44
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions examples/mysql-replication/master/2.7/inventory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# However, this grant is equivalent to specifying *any* hosts, which makes this easier since the docker host
# is not easily known to the Docker container. But don't do this in production.
#

# Oracle Docker image turn replication off while loading initial files, which breaks our replication setup.
# See https://github.com/mysql/mysql-docker/blob/1.2.20-server/mysql-server/8.4/docker-entrypoint.sh#L109
# Turn replication on in the init script.
SET @@SESSION.SQL_LOG_BIN=1;

CREATE USER 'replicator' IDENTIFIED BY 'replpass';
CREATE USER 'debezium' IDENTIFIED BY 'dbz';
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'replicator';
Expand Down
6 changes: 6 additions & 0 deletions examples/mysql-replication/master/3.0/inventory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# However, this grant is equivalent to specifying *any* hosts, which makes this easier since the docker host
# is not easily known to the Docker container. But don't do this in production.
#

# Oracle Docker image turn replication off while loading initial files, which breaks our replication setup.
# See https://github.com/mysql/mysql-docker/blob/1.2.20-server/mysql-server/8.4/docker-entrypoint.sh#L109
# Turn replication on in the init script.
SET @@SESSION.SQL_LOG_BIN=1;

CREATE USER 'replicator' IDENTIFIED BY 'replpass';
CREATE USER 'debezium' IDENTIFIED BY 'dbz';
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'replicator';
Expand Down
6 changes: 6 additions & 0 deletions examples/mysql-replication/master/3.1/inventory.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@
# However, this grant is equivalent to specifying *any* hosts, which makes this easier since the docker host
# is not easily known to the Docker container. But don't do this in production.
#

# Oracle Docker image turn replication off while loading initial files, which breaks our replication setup.
# See https://github.com/mysql/mysql-docker/blob/1.2.20-server/mysql-server/8.4/docker-entrypoint.sh#L109
# Turn replication on in the init script.
SET @@SESSION.SQL_LOG_BIN=1;

CREATE USER 'replicator' IDENTIFIED BY 'replpass';
CREATE USER 'debezium' IDENTIFIED BY 'dbz';
GRANT REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'replicator';
Expand Down

0 comments on commit 0525d44

Please sign in to comment.