Cloud customer?
Start for Free >
Upgrade in MyJFrog >
What's New in Cloud >


Artifactory supports the popular MariaDB fork of MySQL. By using MariaDB you can benefit from features in the MariaDB infrastructure such as backup and restore.

For Artifactory to run with MariaDB you need to create a dedicated MariaDB database instance and then configure Artifactory to use it as described in the following sections.

Before You Continue

Before proceeding with the steps below, please make sure you have read and followed the steps described in Configuring the Database.

Page Contents


Creating the Artifactory MariaDB Database

Supported MariaDB Versions

Artifactory supports MariaDB versions 10.2.9-10.4 and version 10.5.9 (Refrain from using MariaDB 10.5.x versions other than version 10.5.9 due to this known issue).

Supported JDBC Driver Versions

Artifactory supports the MariaDB Java Connector versions 2.1.2 and above.

Note that when using JDBC version 2.4.x and above, you need to add the following flag: useMysqlMetadata=true to the connection string.

Artifactory provides a script that will execute the SQL commands you need to create your MariaDB database.

The script can be found in $JFROG_HOME/artifactory/app/misc/db/createdb/createdb_mariadb.sql and is displayed below.

You should review the script and modify it as needed to correspond to your specific environment.

createdb_mariadb.sql Script
GRANT ALL on artdb.* TO 'artifactory'@'localhost' IDENTIFIED BY 'password';

Once you have verified that the script is correct, you need to run it to create the database and proceed with configuring the database.

Artifactory privileges

If you are running MariaDB database on a Docker container please use the following:

GRANT ALL on artdb.* TO 'artifactory'@'%' IDENTIFIED BY 'password';

Selecting a Case-Sensitive Collation

While MariaDB Database Server is not case-sensitive by default, it is important to select a case-sensitive collation because Artifactory is case-sensitive. 

For example, in the createdb.sql script above COLLATE is set to "utf8_bin".

Artifactory privileges

We recommend providing Artifactory with full privileges on the database.

Configuring Artifactory to use MariaDB

  1. Download the MariaDB JDBC driver (available from the MariaDB website)  and copy the mariadb-java-client-<version>.jar file into $JFROG_HOME/artifactory/var/bootstrap/artifactory/tomcat/lib directory


    Make sure your driver has the same permissions as the rest of the files in the $JFROG_HOME/artifactory/var directory. 

  2. Adjust the database connection details in the Artifactory System YAML.

    For example
        type: mariadb
        driver: org.mariadb.jdbc.Driver
        url: jdbc:mariadb://<your db server url, for example: localhost:3306>/artdb?characterEncoding=UTF-8&elideSetAutoCommits=true&useSSL=false&useMysqlMetadata=true
        username: artifactory
        password: password

Storing BLOBs inside MariaDB

The suggested (and recommended) configuration stores all artifact information in MariaDB while the artifact binary data is stored on the file system (under $JFROG_HOME/artifactory/var/data/artifactory/filestore).
While it is not recommended, it is possible to store BLOBs inside MariaDB provided that the typical BLOB size is relatively small. Storing large BLOBs in MariaDB can cause memory issuesbecause MariaDB buffers BLOBs rather than streaming them (please refer to MySQL Bug #15089) and may result in OutOfMemory errors with large binaries depending on your JVM heap size.

To store BLOBs in MariaDB, you will need to configure the Filestore with the Full-DB and Full-DB-Direct Binary Providers and change max_allowed_packet to be higher than the maximum artifact size you intend to store in Artifactory.

Known Issues

Lightweight Ping Query

The MariaDB Connector/J does not support the special  lightweight "/* ping */" query. JDBC Connection Pools perform regular validity checks on connections in the pool, which use an SQL validation query. 

Increasing MariaDB Default Packet Size

Since some data files (builds, configurations etc.) are stored in MariaDB, it is extremely important to increase the maximum allowed packet size used by MariaDB to avoid errors related to large packets.  

To learn more, please refer to Packet Too Large in the MariaDB.

We recommend changing this parameter in the /etc/my.cnf file as follows:

Modifying /etc/my.cnf
# The MariaDB server
# The maximum size of the binary payload the server can handle

/etc/my.cnf Absolute Path

If /etc/my.cnf does not already exist, you need to create it under the absolute path and not under $JFROG_HOME/artifactory/var.

Restart required

After modifying the maximum allowed packed size you need to restart MariaDB.

You can also use the command line

You can also change the max_allowed_packet variable on the MariaDB command line as in the following example:

SET GLOBAL max_allowed_packet = 134217728;

Note, however, that upon a restart, the value of the max_allowed_packet variable will be read from the /etc/my.cnf file and revert to the value in that file as described above.

Tuning MariaDB for Artifactory

When using Artifactory with MariaDB it is recommended to use the InnoDB engine with the following tuning parameters configured in the /etc/my.cnf file:

Tuning Parameters for MySQL
# The MariaDB server
# By default innodb engine use one file for all databases and tables. We recommend changing this to one file per table.
# NOTE: This will take effect only if Artifactory tables are not created yet! Need to be set and MariaDB restarted before starting Artifactory for the first time.
# Theses are tuning parameters that can be set to control and increase the memory buffer sizes.
# Theses control the innodb log files size and can be changed only when MariaDB is down and MariaDB will not start if there are some innodb log files left in the datadir.
# So, changing theses means removing the old innodb log files before start.

Note that both the XtraDB and InnoDB engines are compatible with the various InnoDB system variables.

Restart required

After tuning MariaDB to work with Artifactory, you need to restart MariaDB.

Both MySql and MariaDB servers do support the “/* ping */” query, but the MariaDB Connector/J wraps the query as if it was a standard SQL query and transforms it into a “SET STATEMENT...” query, which is illegal in terms of syntax as far as the server is concerned. For this reason, Artifactory uses a generic “SELECT 1” as a validation query for pooled connections when MariaDB is used as a database type. The MySql Connector has no such limitation, and supports the “/* ping */” query.

Copyright © 2022 JFrog Ltd.