Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
Using mysql-connector-java in Flink: No suitable driver found when connecting to mysql >= 8.0.16

I am writing a simple Flink program to move data from MySQL to Mongo.

I'm using mysql-connector-java 8.0.16.

The problem

When I try to connect to our test env DB (MySQL 8.0.15) the program works just fine. The connection string looks like this:

jdbc:mysql://my-test-db-url:3306/my_db_name

But once I connect it to our production DB (MySQL 8.0.16), I got:

java.sql.SQLException: No suitable driver found for jdbc:mysql://my-prod-db-url:3306/my_db_name

The only difference of these DBs is the minor version (15 vs 16).

What I have tried

Upgrading test DB to match prod DB version

I upgraded my test DB to 8.0.16 to see if it's a problem with that version of mysql server. And indeed now I can't connect to test DB, too, getting the same exception.

After that I continued to upgrade both mysql-connector-java and test DB to 8.0.17, but the problem still persists.

In my other projects I can connect to those mysql DBs just fine (using spring data jpa with mysql-connector-java 8.0.18). So the db server shouldn't have any problem.

Manually put mysql-connector-java jar into flink/lib folder

This didn't work

Registering the driver manually in main class and my mysql source function's open method

no error was thrown in main class

// tried both
Class.forName("com.mysql.jdbc.Driver").newInstance();
Class.forName("com.mysql.cj.jdbc.Driver").newInstance();

I also made sure after running maven package, my fat jar does contain the connector class files.

Now I'm pretty much clueless. Somebody please save me.

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

I resolved same issue using Class.forName("org.sqlite.JDBC") (I were using sqlite) before calling DriverManager.getConnection. It's almost same that you've tried but without calling newInstance().

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda