Using MySQL

This chapter explains how to use MySQL as the ManualWorks database.

MySQL 8.0 and later are officially supported. If you use MySQL, back up your data with the database's own backup features.

To store 4-byte characters such as emoji, create the database with the utf8mb4 character set. A database created with the utf8 (utf8mb3) character set cannot store these characters. The following example creates the rabbitz database.

CREATE DATABASE rabbitz CHARACTER SET utf8mb4;

Adding the MySQL JDBC Driver

3RABBITZ_HOME refers to the directory where ManualWorks is installed.

Add the JDBC driver for your MySQL version to the 3RABBITZ_HOME/web/WEB-INF/lib directory.

Download the MySQL JDBC driver from the MySQL website. For MySQL 8.0.32, use the mysql-connector-j-8.0.32.jar driver.

Changing the Configuration File

Configure ManualWorks to use MySQL as follows.

  1. Open the 3RABBITZ_HOME/tomcat/conf/server.xml file.

<Context docBase="${3rabbitz.home}/web" path=""
  reloadable="false" backgroundProcessorDelay="3">
  <CookieProcessor className="org.apache.tomcat.util.http.LegacyCookieProcessor" />
  <!-- H2 -->
  <Resource name="jdbc/Base" auth="Container" type="javax.sql.DataSource"
    driverClassName="org.h2.Driver" url="jdbc:h2:h2/database;"
    username="database" password="database"
    maxTotal="100" maxIdle="30" maxWaitMillis="10000"/>
  <!-- for MySQL -->
  <!--
  <Resource name="jdbc/Base" auth="Container" type="javax.sql.DataSource"
    maxTotal="100" maxIdle="30" maxWaitMillis="10000"
    username="username" password="password"
    driverClassName="com.mysql.cj.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/rabbitz" />
  -->
</Context>
  1. Comment out the H2 settings.

  2. Uncomment the MySQL settings.

  3. Change username, password, url, and other values.

  4. Start ManualWorks.

ManualWorks creates its tables automatically during installation and software updates. The MySQL account set in username must have privileges to create tables, alter columns, and create and drop indexes.

The server.xml file contains the database account password in plain text. Restrict the file permissions so that only the account that runs ManualWorks can read it. To encrypt the connection information, see Encrypting Database Connection Information.