Artifactory provides a script that will execute the SQL commands you need to create your MySQL database.
You can find the script in $JFROG_HOME/artifactory/app/misc/db/createdb/createdb_mysql.sql
.
You should review the script and modify it as needed to correspond to your specific environment.
createdb.sql script
CREATE DATABASE artdb CHARACTER SET utf8 COLLATE utf8_bin; CREATE USER 'artifactory'@'%' IDENTIFIED BY 'password'; GRANT ALL on artdb.* TO 'artifactory'@'%'; FLUSH PRIVILEGES;
Once you have verified that the script is correct, you need to run it to create the database and proceed with configuring the database.
Selecting a Case-Sensitive Collation
While MySQL 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"
.
UTF8MB4 is not supported. We recommend that you adhered to the default "utf8_bin".
Artifactory privileges
We recommend providing Artifactory with full privileges on the database
Enable MySQL Connectivity from Remote Servers
The following is an example for enabling MySQL connectivity from remote servers. For your organization's best practices, consult with your security team.
To bind the IP addresses, you should edit the configuration file /etc/mysql/mysql.conf.d/mysqld.cnf
and change the default IP address value by separating each address with a comma. The directive to edit is the bind-address
.
You can bind to all available IP addresses:
bind-address = 0.0.0.0
Restart the MySQL service to save the modifications.