Skip to content

Latest commit

 

History

History

Database-Connection

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

In this chapter we are going to learn How to connect Apache NiFi to different types of databases.

conn

Find the Full Youtube Tutorial here Connect NiFi to any Database

Connect Apache NiFi to Mysql Database.

jdbc:mysql://#{db_host}:#{db_port}/#{db_name}

Driver Class

com.mysql.jdbc.Driver

JDBC Driver location

MySQL Driver

Connect Apache NiFi to PostgreSQL Database.

jdbc:postgresql://#{db_host}:#{db_port}/#{db_name}

Driver Class

com.mysql.jdbc.Driver

JDBC Driver location

PostgreSQL Driver

Follow this link for more DB Driver and their jdbc url config.

DBSchema

Download the drivers into folder drivers on the NiFi host

mkdir -p /<nifi home directory>/drivers

Create the Parameter Context for the MySQL Database (optional via Toolkit)

See how to setup NiFi toolkit here Setup NiFi Env

cd ApacheNifi
nifi import-param-context -i 'Database-Connection/parameter-context/mysql-config.json' -u http://localhost:8081
nifi import-param-context -i 'Database-Connection/parameter-context/postgres-config.json' -u http://localhost:8081

Note: - make sure you don`t commit your passwords :)