1

I am trying to write data from Kafka consumer to MySQL using JDBC. I am able to take data from databases like MySQL, PostgreSQL using JDBC but not able to write the data to a database. However I am able to write the data to a text file.

What am I missing or should do?

metadaddy
  • 4,234
  • 1
  • 22
  • 46
  • 1
    What exactly are the errors you get? Also, have you tried using Kafka Connect JDBC? – OneCricketeer May 30 '18 at 12:44
  • Error Code: 1109 Message: Unknown table 'data' in information_schema. This I found in log when I`m trying to write data to a mysql database from a local csv file. The only problem is this error no matter how I try to write into a mysql database. – Anurag Gupta May 31 '18 at 06:12
  • `information_schema` is the default database. What's the actual database you're trying to insert into? Obviously `data` is the table name, but you can must use `db.data` for a given `db` database – OneCricketeer May 31 '18 at 13:45
  • I've made a student database and inside it a table named data. – Anurag Gupta May 31 '18 at 13:53
  • 1
    Okay, can you please share your Streamsets configuration properties with an [edit] to the question? – OneCricketeer May 31 '18 at 13:54
  • I would like to mention that Kafka Connect can be used to send data to databases as well. – OneCricketeer May 31 '18 at 13:55
  • With kafla connect? Without jdbc? Can you please provide me any doc link for that? – Anurag Gupta May 31 '18 at 14:02
  • With JDBC. https://docs.confluent.io/current/connect/connect-jdbc/docs/index.html Note: It does not require Confluent installed Kafka, you can check out a release branch and build from https://github.com/confluentinc/kafka-connect-jdbc – OneCricketeer May 31 '18 at 14:04
  • Thanks. I'll definitely try that. :) – Anurag Gupta May 31 '18 at 14:06

0 Answers0