MYSQL database setup

This page aims to set up a simple MYSQL database for a quick start of the CDC adapter.

For this purpose, we will be using the MySQL Docker image provided by Debezium. This image contains a pre-populated database called inventory, which will be used for this example.

Requirement

  1. Docker

Steps

  1. Run the MySQL docker image:

    docker run -it --rm --name mysql -p 3306:3306 -e MYSQL_ROOT_PASSWORD=debezium -e MYSQL_USER=mysqluser -e MYSQL_PASSWORD=mysqlpw debezium/example-mysql:2.6.1.Final
  2. Start MySQL client:

    docker run -it --rm --name mysqlterm --link mysql --rm mysql:8.0.36-debian sh -c 'exec mysql -h"$MYSQL_PORT_3306_TCP_ADDR" -P"$MYSQL_PORT_3306_TCP_PORT" -uroot -p"$MYSQL_ENV_MYSQL_ROOT_PASSWORD"'
  3. In MYSQL client, set required permission:

    GRANT SELECT, RELOAD, SHOW DATABASES, REPLICATION SLAVE, REPLICATION CLIENT ON *.* TO 'mysqluser';