Artifactory MySQL Database Creation
Run the createdb_mysql.sql script to create the MySQL database with utf8_bin collation, then enable remote connectivity by configuring bind-address.
Artifactory provides a script that executes the SQL commands needed to create your MySQL database. The script is located at $JFROG_HOME/artifactory/app/misc/db/createdb/createdb_mysql.sql.
The default createdb.sql script is shown below. Note the following:
- MySQL database server is not case-sensitive by default, but Artifactory is case-sensitive. Select a case-sensitive collation. The default script specifies
utf8_bin. UTF8MB4 is not supported. We recommend keeping the defaultutf8_bin. - We recommend providing Artifactory with full privileges on the database, as shown in the default script.
CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin;
-- Replace <REPLACE_WITH_DB_PASSWORD> with a quoted password before running this script.
CREATE USER 'artifactory'@'%' IDENTIFIED BY <REPLACE_WITH_DB_PASSWORD>;
GRANT ALL on artdb.* 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.
Review the script and modify it as needed for your environment, including the database name, username, host restrictions, and granted privileges. Then run it to create the database.
Enable MySQL Connectivity from Remote Servers
The following example shows how to enable MySQL connectivity from remote servers. For your organization's best practices, consult with your security team.
To bind the IP addresses, edit the file /etc/mysql/mysql.conf.d/mysqld.cnf and modify the bind-address parameter. Change the default IP address to a comma-separated list of addresses. To bind to all available IP addresses, set the value to 0.0.0.0.
Restart the MySQL service to save the modifications.
Related Topics
Updated about 1 month ago
