Mysql Sink Connector

Hi all

In the Kafka 101 Connect tutorials they use/reference to MySQLSinkConnector.

I’m running the CP stack locally… is this a connector thats only available in the cloud ?

on the back of this i tried installing the debezium connector, it goes through (plugin install), but after the connect restart it’s plugin is still not showing… so thought let me try the JDBC sink connector… pointing it at a local dockerized mysql db… connector create is failing.

i’m expecting a table to be created called transactions… but no such luck.

G

curl --request POST \
  --url 'http://127.0.0.1:8083/connectors' \
  --header 'content-type: application/json' \
  --data '{
  "name": "MySqlSinkConnector_0",
  "config": {
  	"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
  	"name": "MySqlSinkConnector_0",
  	"topics": "transactions",
 	"connection.url": "jdbc:mysql://127.0.0.1:3306/demo",
  	"input.data.format": "AVRO",
  	"input.key.format": "AVRO",
  	"connection.user": "kc101user",
  	"connection.password": "kc101pw",
  	"db.name": "demo",
  	"insert.mode": "INSERT",
  	"auto.create": "true",
  	"auto.evolve": "true",
  	"tasks.max": "1"
	}
}'

Error as per connect log

[2024-06-04 19:04:31,705] ERROR [MySqlSinkConnector_0|task-0] WorkerSinkTask{id=MySqlSinkConnector_0-0} Task threw an uncaught and unrecoverable exception. Task is being killed and will not recover until manually restarted. Error: java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1/demo (org.apache.kafka.connect.runtime.WorkerSinkTask:632)
org.apache.kafka.connect.errors.ConnectException: java.sql.SQLException: No suitable driver found for jdbc:mysql://127.0.0.1:3306/demo

solved…

needed to copy the mysql jar file into my hub connect directory.

G

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.