Artifactory MariaDB Database Creation
Run the createdb_mariadb.sql script to create the MariaDB database, grant Artifactory privileges, and apply a case-sensitive utf8_bin collation.
Artifactory provides a script that executes the SQL commands needed to create your MariaDB database.
The script is located at $JFROG_HOME/artifactory/app/misc/db/createdb/createdb_mariadb.sql.
Review the script and modify it as needed for your environment.
createdb_mariadb.sql Script
CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin;
-- Replace <REPLACE_WITH_DB_PASSWORD> with a quoted password before running this script.
GRANT ALL on artdb.* TO 'artifactory'@'%' IDENTIFIED BY <REPLACE_WITH_DB_PASSWORD>;
GRANT SUPER ON *.* TO 'artifactory'@'%';
FLUSH PRIVILEGES;Replace the placeholder password
This example uses a placeholder instead of a runnable default password. Replace
<REPLACE_WITH_DB_PASSWORD>with a strong password of your own choosing before running the script, and use that same password when you setshared.database.passwordin system.yaml (or the supported environment-variable override). Do not leave the placeholder in a production setup.
After verifying that the script is correct for your environment — including the database name, username, host restrictions, and granted privileges — run it to create the database and proceed with configuring the database.
If you are running a MariaDB database in a Docker container, use the following script.
CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin;
-- Replace <REPLACE_WITH_DB_PASSWORD> with a quoted password before running this script.
GRANT ALL on artdb.* TO 'artifactory'@'%' IDENTIFIED BY <REPLACE_WITH_DB_PASSWORD>;
GRANT SUPER ON *.* TO 'artifactory'@'%';
FLUSH PRIVILEGES;Selecting a Case-Sensitive Collation
While MariaDB Database Server is not case-sensitive by default, select a case-sensitive collation because Artifactory is case-sensitive.
For example, in the
createdb.sqlscript above COLLATE is set to "utf8_bin".
Artifactory privileges
We recommend providing Artifactory with full privileges on the database.
Related Topics
Updated about 1 month ago
