Using Zeppelin to Access MySQL

If you want to access MySQL Cloud Service using Zeppelin of Oracle Big Data Cloud Service Compute Edition (BDCSCE), you can use Spark DataFrames or Zeppelin interpreters. In this blog post, I’ll show how we can edit JDBC interpreter to connect MySQL Cloud Service.

First login to Oracle Big Data Cloud console, and go to “settings” tab, and open “notebook” section. You’ll see the interpreter settings. Search for “jdbc” and click “edit” button to edit the interpreter settings.

MySQL connector is already included in Zeppelin coming with Oracle Big Data Compute Edition service, but if it’s not included, download “MySQL Connector/J” from to your Zeppelin server, and add the path to the dependencies. Add the required the following to the properties:

mysql.user – the mysql user name you will use to connect the DB
mysql.password – plain text password (it will be encrypted by Zeppelin)
mysql.url – the connection URL (something like jdbc:mysql://servername:3306/dbname)
mysql.driver – com.mysql.jdbc.Driver

Then click SAVE button. Zeppelin will ask your confirmation to update the settings and restart the interpreter. Click OK to continue. If you want to create it as a separate interpreter, instead of editing JDBC, create a new one and enter the properties and dependencies.

Now it’s time to test our MySQL connection. Open a Zeppelin notebook, add the “%jdbc(mysql)” directive at the start of a paragraph and run a query. If the Zeppelin interpreter gets an error while running the query, it throws a detailed error message, so you can fix the problem easily.

Please share

AWS Big Data Specialist. Oracle Certified Professional (OCP) for EBS R12, Oracle 10g and 11g. Co-author of "Expert Oracle Enterprise Manager 12c" book published by Apress. Awarded as Oracle ACE (in 2011) and Oracle ACE Director (in 2016) for the continuous contributions to the Oracle users community. Founding member, and vice president of Turkish Oracle User Group (TROUG). Presented at various international conferences including Oracle Open World.

Leave Comment

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.