Skip to content

Commit

Permalink
#40: Update User Guide on Registering the JDBC Driver
Browse files Browse the repository at this point in the history
  • Loading branch information
kaklakariada committed Sep 29, 2023
1 parent b8810d2 commit 7f823d0
Showing 1 changed file with 18 additions and 28 deletions.
46 changes: 18 additions & 28 deletions doc/user_guide/mysql_user_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-<versions>.jar` (older versions: `mysql-connector-java-<version>.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

Expand Down

0 comments on commit 7f823d0

Please sign in to comment.