'Debezium Connector - Communication link failure

i got issue when connect local mysql using docker

{"error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nUnable to connect: Communications link failure\n\nThe last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server.\nYou can also find the above list of errors at the endpoint /connector-plugins/{connectorType}/config/validate"}

here my configuration :

 {
  "name": "inventory-connector",
  "config": {
    "connector.class": "io.debezium.connector.mysql.MySqlConnector",
    "tasks.max": "1",
    "database.hostname": "mysql",
    "database.port": "3306",
    "database.user": "debezium",
    "database.password": "dbz",
    "database.server.id": "184054",
    "database.server.name": "dbserver1",
    "database.include.list": "inventory",
    "database.allowPublicKeyRetrieval":"true",
    "database.history.kafka.bootstrap.servers": "kafka:9092",
    "database.history.kafka.topic": "schema-changes.inventory"
  }
}

this my mysql docker-compose.yaml

version: '3.3'

services:
  mysql:
    image: quay.io/debezium/example-mysql:1.9
    container_name: mysql
    environment:
      - MYSQL_USER=mysqluser
      - MYSQL_PASSWORD=mysqlpw
      - MYSQL_ROOT_PASSWORD=debezium
    volumes:
      - ./mysqldb_data:/var/lib/mysql
    ports:
      - 3306:3306

networks:
  zookeeper_default:
    external:
      name: zookeeper_default

let me know if you know anything, thanks



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source