Configuring a MySQL or MariaDB database

Before installing the HCL DevOps Deploy (Deploy) server, you must set up a supported MySQL or MariaDB instance. This process involves configuring UTF-8 encoding, creating a dedicated database user, and obtaining the JDBC driver for the Deploy server installation process.

Before you begin

Ensure that you have performed the following tasks:
  • Installed the MySQL or MariaDB database on a system.

    MySQL and MariaDB are similar databases where you can choose one depending on your operating system and version. In a production environment, you install the database on a dedicated system. If you are evaluating Deploy, you can install the database on the same system as the Deploy server. See Databases for a list of supported database versions.

    Refer to the MySQL Installation guide or MariaDB Installation guide for installation instructions.

  • Set the database to start automatically on boot. For example, run the following command on a Linux system that uses systemctl:

    MariaDB: systemctl enable mariadb; systemctl start mariadb

    MySQL: systemctl enable mysqld; systemctl start mysqld

  • Set the database to use UTF-8 encoding:
    1. On the system that hosts the database, open the MySQL or MariaDB configuration file.

      The location of the file depends on the operating system. On Linux, the file is named my.cnf, and many distributions, the file is located in the /etc or /etc/mysql folder. On Windows, the file is named as my.ini.

    2. In the [mysqld] section of the configuration file, add the following lines:
      character-set-server=utf8
      character-set-filesystem=utf8
    3. Apply the changes by restarting the database. For example, to restart MariaDB on Linux, use this command:
      systemctl restart mariadb
  • Changed the database to a case-sensitive collation.

About this task

When you install Deploy, you need the database connection information, and a user account with table-creation privileges.

Procedure

  1. Open a command-line window and log in to the database.
    MySQL: mysql -u username -ppassword
    MariaDB: mariadb -u username -ppassword
    For username, specify the user name for the database. The default user name is root. For password, specify the password for that user name. The default account has no password; in this case, omit the -p flag and the password.
    Note: Do not insert a space between the -p flag and the password.
  2. Create a database and user by running the following commands, replacing placeholders with your specific values.
    CREATE USER 'dbUser'@'localhost' IDENTIFIED BY 'password';
    CREATE DATABASE dbName DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_bin;
    Where,
    • dbUser is the username for the database.
    • dbName is the database name. Such as deploydb.
    • utf8_bin ensures the required case-sensitive collation.
  3. Grant all permissions to the database user.
    GRANT ALL PRIVILEGES ON dbName.* TO 'dbUser'@'localhost';
    FLUSH PRIVILEGES;
  4. Log out of the database command line.
  5. Obtain the database JDBC driver.

    Refer to the official website of your specific database provider for downloading the appropriate JDBC driver. The driver files are specific to the database edition you are using.

    When multiple drivers are available, you might need to consult with the database provider to determine which driver to use. The JDBC driver version that you must use might depend on the version of the database and the version of Java used by the Deploy server.

  6. Copy the JDBC JAR file to the installerDirectory\lib\ext folder.

What to do next

You can now run the Deploy server installer and provide the following details when prompted:
Detail MySQL default MariaDB default
Database type mysql mariadb
JDBC driver class com.mysql.cj.jdbc.Driver org.mariadb.jdbc.Driver
Connection string jdbc:mysql://dbURL:dbPORT/dbNAME

Example connection string: jdbc:mysql://localhost:3306/deploydb

jdbc:mariadb://dbURL:dbPORT/dbNAME

Example connection string: jdbc:mariadb://localhost:3306/deploydb

Database username and password See step 2. See step 2.