Configuring a MySQL or MariaDB database
Before you begin
- 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 mariadbMySQL:
systemctl enable mysqld; systemctl start mysqld - Set the database to use UTF-8 encoding:
- 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.
- In the
[mysqld]section of the configuration file, add the following lines:character-set-server=utf8 character-set-filesystem=utf8 - Apply the changes by restarting the database. For example, to restart MariaDB on
Linux, use this command:
systemctl restart mariadb
- On the system that hosts the database, open the MySQL or MariaDB configuration file.
- Changed the database to a case-sensitive collation.
About this task
Procedure
What to do next
| 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/dbNAMEExample
connection string: |
jdbc:mariadb://dbURL:dbPORT/dbNAMEExample
connection string:
|
| Database username and password | See step 2. | See step 2. |