Make sure to include
mysql-metadata-storage as an extension.
This extension uses Oracle's MySQL JDBC driver which is not included in the Druid distribution and must be installed separately. There are a few ways to obtain this library:
libmysql-javaon APT for a Debian-based OS
This should fetch a JAR file named similar to 'mysql-connector-java-x.x.xx.jar'.
Copy or symlink this file to
extensions/mysql-metadata-storage under the distribution root directory.
Use your favorite package manager to install mysql, e.g.:
- on Ubuntu/Debian using apt
apt-get install mysql-server
- on OS X, using Homebrew
brew install mysql
Alternatively, download and follow installation instructions for MySQL Community Server here: http://dev.mysql.com/downloads/mysql/
Connect to MySQL from the machine where it is installed.
> mysql -u root
Paste the following snippet into the mysql prompt:
-- create a druid database, make sure to use utf8mb4 as encoding CREATE DATABASE druid DEFAULT CHARACTER SET utf8mb4; -- create a druid user, and grant it all permission on the database we just created GRANT ALL ON druid.* TO 'druid'@'localhost' IDENTIFIED BY 'diurd';
Add the following parameters to your Druid configuration, replacing
with the location (host name and port) of the database.
druid.extensions.loadList=["mysql-metadata-storage"] druid.metadata.storage.type=mysql druid.metadata.storage.connector.connectURI=jdbc:mysql://<host>/druid druid.metadata.storage.connector.user=druid druid.metadata.storage.connector.password=diurd
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 guide.
||The file path URL to the client certificate key store.||none||no|
||The type of the key store where the client certificate is stored.||none||no|
||The Password Provider or String password for the client key store.||none||no|
||Enables server certificate verification.||false||no|
||The file path to the trusted root certificate key store.||Default trust store provided by MySQL||yes if
||The type of the key store where trusted root certificates are stored.||JKS||yes if
||The Password Provider or String password for the trust store.||none||yes if
||Overrides the existing cipher suites with these cipher suites.||none||no|
||Overrides the TLS protocols with these protocols.||none||no|