1

I am trying to connect MySQL DB (installed in my laptop) from Confluent Cloud Remote access using MySQL Source connector. I am not able to establish the connection with MySQL Connector.

Error: Unable to validate configuration. If an update was made to the configuration, this means that the configuration was invalid, and the connector continues to operate on a previous configuration that passed validation. Errors:
connection.password: Could not connect to database
table.whitelist: Unable to check whether table(s) exist due to connection error

The same JDBC connection works via a Java program on my laptop.

Sample program I used:

try {
    // connect way #1
    String url1 = "jdbc:mysql://192.168.2**.**:3306/test_kafka_connectors";
    String user = "Adhi";
    String password = "*****";

    conn1 = DriverManager.getConnection(url1, user, password);
    if (conn1 != null) {
        System.out.println("Connected to the database test1");
    }

The hostname (localhost with port 3306 or 192.168.2**.**:3306 (my laptop IP address) works fine in the Java program.

With Confluent connector, I am not able to establish the connection. Steps which I have done below

Step 1. I have added the connection string details and username and password inside the connector.

Authentication
Connection host\
192.168.2**.2**
Connection port
3306
Connection user
Adhi
Connection password
****************
Database name
test_kafka_connectors
SSL mode
prefer

Step 2. Created the user (Adhi with IP address of Confluent) and granted the permission in MySQL below. Please refer db user image.

enter image description here

Step 3: I tried to place the bind address property of Confluent IP address in MySQL conf file mysqlrouter.conf and restarted the mysql service, but still the Connector connection is not working.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Adhish
  • 65
  • 9
  • Bind addresses are for the server, not defining "what is allowed to connect, externally". You should bind to `0.0.0.0` to allow all connections. – OneCricketeer Jun 02 '23 at 20:52

1 Answers1

0

192.168.2**.2** is your LAN subnet within your home network. You need to use your public IP, provided by your ISP. You also need to port-forward 3306 through your router.


Unclear why you "need" Confluent Cloud. You should be able to run Kafka Connect JDBC connector (and Kafka) on your local machine along with MySQL.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • #oneCricketeer , I installed Confluent Kafka in my local and tried to connect MySQL using JDBC connector, i could not see the connection success in Confluent center. It is failed and there is no message displayed in Confluent control Center UI page for the JDBC connector. I am able to connect MySQL DB via Java JDBC program with same connection string. – Adhish Jun 06 '23 at 09:32
  • I personally do not use Control Center, so cannot help with that. You don't need Confluent Platform, only the JDBC connector and Apache Kafka (there's no such thing as Confluent Kafka) – OneCricketeer Jun 06 '23 at 12:32