Creating a DB connection from Kettle to MySQL involves creating a MySQL use who can access the DB in question, installing the JDBC driver, and creating a connection.
Install the MySQL JDBC driver
Download the MySQL JDBC driver from http://dev.mysql.com/downloads/connector/j/.
Login to mysql.com, then click Download.
tar -xzf mysql-connector-java-5.1.20.tar.gz
cp mysql-connector-java-5.1.20-bin.jar ~/bin/data-integration/libext/
Create a MySQL user
In this post, I am going to create a connection to the Sakila DB.
mysql -u root -p
At the MySQL command prompt, enter the following (replace ‘password’ with your password):
mysql> GRANT ALL ON sakila.* TO akbar@localhost IDENTIFIED BY 'password';
Create the DB connection in Kettle
- Click the New in the PDI toolbar.
- Click Database connection.
- Enter information similar to what’s shown below:
- Click Test.
- Click OK.
In Explorer in the left pane of PDI, right-click on the Sakila database connection, click Explore.
You should now be able to view the tables in the Sakila database.