Knowledge Base

Configuring MySQL 8

Last Modified:
04 Jul 2023
User Level:
Administrator

Terminalfour 8.3.14 introduced support for MySQL 8.0. Below is some guidance on configuring it if you are self-hosted.

Database table engine, collations, and charset

Table Engine InnoDB is the preferred and supported database table engine for MySQL 5.7 and MySQL 8.0. All tables should be using InnoDB.
CHARSET  utf8mb4*
COLLATE utf8mb4_0900_ai_ci

*utf8mb3 should not be used

Ensure that the character sets are set correctly on the database

In my.cnf (Linux) or my.ini (Windows), edit the file, and add the following:

[mysql]
default-character-set=utf8mb4
[mysqld]
character-set-server=utf8mb4

MySQL JDBC

The newer version of the JDBC driver must be used and placed into Tomcat's lib directory. 

Tomcat server.xml

Some changes are required to the Tomcat server.xml file

Resource driverClassName

<!--This class path works but it is deprecated and should be changed-->
driverClassName="com.mysql.jdbc.Driver"
 

<!--Change it to the following, note the "cj"-->
driverClassName="com.mysql.cj.jdbc.Driver"