8.6.4 MySQL and MariaDB

This section contains information that is specific to the database type MySQL and its open-source variant MariaDB. If using with MariaDB, you can just select MySQL from the Database profile and it will be compatible.

Supported Functions

 The MySQL and MariaDB database can be used with:

  •  Database Bulk Lookup Functions (APL)
  •  Database Table Related Functions (APL)
  •  Event Notifications
  •  Prepared Statements (APL)
  •  SQL Collection/Forwarding Agents
  •  SQL Loader Agent
  •  Task Workflows Agents (SQL)

Warning!

SQL Loader Agent does not support MariaDB.

Properties

When selecting the MySQL database type, you can configure the following property using the Properties tab in the Database profile:

mysql.connectionpool.maxlimit

Preparations

The MySQL driver has to be downloaded to the Platform to connect to a MySQL or MariaDB database from .

You must proceed as follows:

  1. Go to the MySQL web page and download Connector/J from MySQL Connectors:
    https://dev.mysql.com/downloads/connector/j/

    Note!

    For supported versions, see Database Types.

    You may have to disable any popup blockers you have activated in order to find it.

  2. Place the downloaded jar file in the $MZ_HOME/3pp directory.

  3. Restart the Platform and EC/ECSAs for the change to take effect.


In addition, you must carry out the following preparations before attempting to connect to a MySQL database. The next step is to set the necessary transaction isolation levels. Edit the mysqld configuration files by adding this line: 

mysqld Configuration File
transaction-isolation = READ-COMMITTED


To decrease re-connection overhead, database connections are saved in a connection pool. To set the connection pool size, set the Execution Context property mysql.connectionpool.maxlimit in the relevant <pico>.conf file:

$ mzsh topo set topo://container:<container>/pico:<pico name>/val:config.properties.mysql.connectionpool.maxlimit 45