This extension can use Oracle’s MySQL JDBC driver which is not included in the Druid distribution. You must install it separately. There are a few ways to obtain this library:
- It can be downloaded from the MySQL site at:
- It can be fetched from Maven Central at: https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.48/mysql-connector-java-5.1.48.jar
- It may be available through your package manager, e.g. as
libmysql-java
on APT for a Debian-based OS
This fetches the MySQL connector JAR file with a name like mysql-connector-java-5.1.48.jar
.
Copy or symlink this file inside the folder extensions/mysql-metadata-storage
under the distribution root directory.
This extension also supports using the MariaDB connector jar, though it is also not included in the Druid distribution, so you must install it separately.
- Download from the MariaDB site:
Copy or symlink this file to extensions/mysql-metadata-storage
under the distribution root directory.
To configure the mysql-metadata-storage
extension to use the MariaDB connector library instead of MySQL, set druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver
.
Depending on the MariaDB client library version, the connector supports both jdbc:mysql:
and connection URIs. However, the parameters to configure the connection vary between implementations, so be sure to check the documentation for details.
- Install MySQL
Use your favorite package manager to install mysql, e.g.:
- on Ubuntu/Debian using apt
apt-get install mysql-server
- on OS X, using
brew install mysql
Alternatively, download and follow installation instructions for MySQL Community Server here: http://dev.mysql.com/downloads/mysql/.
- Create a druid database and user
Connect to MySQL from the machine where it is installed.
Paste the following snippet into the mysql prompt:
Add the following parameters to your Druid configuration, replacing <host>
with the location (host name and port) of the database.
If using the MariaDB connector library, set druid.metadata.mysql.driver.driverClassName=org.mariadb.jdbc.Driver
.
This extension provides support for encrypting MySQL connections. To get more information about encrypting MySQL connections using TLS/SSL in general, please refer to this .