I am trying to connect to a MySQL store as a sink using the JDBC connector for Confluent 6.2 but Connect is throwing the following exception:
org.apache.kafka.connect.errors.ConnectException: java.sql.SQLException: No suitable driver found for jdbc:mysql://AAA.BBB.CCC.DDD:3306/new_employees
I've tried placing the mysql-connector-java-8.0.26.jar
in a number of different folders in the Confluent installation including share/java
(that's listed in the SO answer referenced link below) and share/java/kafka-connect-jdbc
(had to create that folder; based on the "Yeah, trust me" comment in https://supergloo.com/kafka-connect/kafka-connect-mysql-example/ and the confluent documentation at https://docs.confluent.io/kafka-connect-jdbc/current/index.html), but Confluent doesn't seem to be looking anywhere I've placed it.
I have read through the answers at No suitable driver found for jdbc:mysql in Kafka Connect, but that is old, and the situation seems to have changed for Confluent version 6.2. I have also verified the connection string and credentials using VSCode.
Here is the connect configuration I'm using (edited for security purposes):
{
"name": "JdbcSinkConnectorConnector",
"config": {
"connector.class": "io.confluent.connect.jdbc.JdbcSinkConnector",
"topics": "emp.employees.departments, emp.employees.dept_emp, emp.employees.dept_manager, emp.employees.employees, emp.employees.salaries, emp.employees.titles",
"connection.url": "jdbc:mysql://AAA.BBB.CCC.DDD:3306/new_employees",
"connection.user": "XXXXXX",
"connection.password": "YYYYYY",
"dialect.name": "MySqlDatabaseDialect",
"insert.mode": "upsert",
"auto.create": "true",
"auto.evolve": "true"
}
}
So, the question is, where does Confluent look for the MySQL driver jar file for connecting to MySQL as a sink?