From 7f823d05984eb2d0a3ac4ad367a476d557d6d89d Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Fri, 29 Sep 2023 09:14:00 +0200 Subject: [PATCH] #40: Update User Guide on Registering the JDBC Driver --- doc/user_guide/mysql_user_guide.md | 46 ++++++++++++------------------ 1 file changed, 18 insertions(+), 28 deletions(-) diff --git a/doc/user_guide/mysql_user_guide.md b/doc/user_guide/mysql_user_guide.md index 794c019..20dabe6 100644 --- a/doc/user_guide/mysql_user_guide.md +++ b/doc/user_guide/mysql_user_guide.md @@ -2,40 +2,30 @@ [MySQL](https://www.mysql.com/) is an open-source relational database management system. -## Registering the JDBC Driver in EXAOperation +## Uploading the JDBC Driver to Exasol BucketFS -First download the [MySQL JDBC driver](https://dev.mysql.com/downloads/connector/j/). -Select Operating System -> Platform Independent -> Download. +1. Download the [MySQL JDBC driver](https://dev.mysql.com/downloads/connector/j/). Select Operating System -> Platform Independent -> Download. +2. Upload the driver to BucketFS, see the [BucketFS documentation](https://docs.exasol.com/db/latest/administration/on-premise/bucketfs/accessfiles.htm) for details. -Now register the driver in EXAOperation: + Hint: Put the driver into folder `default/drivers/jdbc/` to register it for [ExaLoader](#registering-the-jdbc-driver-for-exaloader), too. -1. Click "Software" -1. Switch to tab "JDBC Drivers" -1. Click "Browse..." -1. Select JDBC driver file -1. Click "Upload" -1. Click "Add" -1. In a dialog "Add EXACluster JDBC driver" configure the JDBC driver (see below) +## Registering the JDBC driver for ExaLoader -You need to specify the following settings when adding the JDBC driver via EXAOperation. +In order to enable the ExaLoader to fetch data from the external database you must register the driver for ExaLoader as described in the [Installation procedure for JDBC drivers](https://github.com/exasol/docker-db/#installing-custom-jdbc-drivers). +1. ExaLoader expects the driver in BucketFS folder `default/drivers/jdbc`. -| Parameter | Value | -|------------------|-------------------------------------------------------------------------------------------| -| Driver Name | `MYSQL` | -| Main Class | `com.mysql.cj.jdbc.Driver` (for versions below major version 8 it was `com.mysql.jdbc.Driver`) | -| Prefix | `jdbc:mysql:` | -| Files | `mysql-connector-j-.jar` (older versions: `mysql-connector-java-.jar`) | -| Port (optional) | default 3306 | + If you uploaded the driver for UDF to a different folder, then you need to [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) the driver again. +2. Additionally you need to create file `settings.cfg` and [upload](#uploading-the-jdbc-driver-to-exasol-bucketfs) it to the same folder in BucketFS: -IMPORTANT: Currently you have to **Disable Security Manager** for the driver if you want to connect to MySQL using Virtual Schemas. -It is necessary because JDBC driver requires a JAVA permission which we do not grant by default. - -## Uploading the JDBC Driver to BucketFS - -1. [Create a bucket in BucketFS](https://docs.exasol.com/administration/on-premise/bucketfs/create_new_bucket_in_bucketfs_service.htm) -1. Upload the driver to BucketFS - -This step is necessary since the UDF container the adapter runs in has no access to the JDBC drivers installed via EXAOperation but it can access BucketFS. +```properties +DRIVERNAME=MYSQL +JAR=mysql-connector-j.jar +DRIVERMAIN=com.mysql.jdbc.Driver +PREFIX=jdbc:mysql: +NOSECURITY=YES +FETCHSIZE=100000 +INSERTSIZE=-1 +``` ## Installing the Adapter Script