Using Zeppelin to Access MySQL

    Jan 14, 2018 12:19:38 PM by Gokhan Atil

    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.

    interpreter-settings

    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.

    dependencies

    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 mysql.com 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

    confirm-message

    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.

    runaquery

    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.

     

    Tags: MySQL

    Gokhan Atil

    Written by Gokhan Atil

    Gokhan Atil has over 15 years of experience in the IT industry and a strong background in database management (Oracle 8i,9i,10g,11g), software development and UNIX systems. He is an Oracle certified professional for EBS R12, Oracle 10g and 11g. Gokhan specializes in high availability solutions, performance tuning and monitoring tools. Gokhan is a founding member and current vice president of Turkish Oracle User Group (TROUG). He’s also a member of Independent Oracle User Group (IOUG). Gokhan presented at various conferences, and he is one of co-authors of “Expert Oracle Enterprise Manager 12c” book.