Skip to Content
IntegrationsMySQL / MariaDB

MySQL / MariaDB

Collection MYSQL and Delivery MYSQL_EXEC. A single connection type, MySQL / MariaDB, serves both databases — the protocol is the same. Test Connection says which one answered: MySQL 8.4.13 or MariaDB 11.4.14.

The design is the same as the other SQL databases — SELECT Query, marking what has been read with :ids, result mode and :name placeholders —, described in Databases. This page covers only what is specific to MySQL.

Connection

MySQL / MariaDB connection: host, database, SSL mode and Keep Alive query
MySQL / MariaDB connection: host, database, SSL mode and Keep Alive query
MySQL / MariaDB connection: host, database, SSL mode and Keep Alive query
FieldWhat it is for
Host / PortMySQL or MariaDB server. Defaults to 3306
DatabaseDatabase opened on the connection
Username / PasswordThe user must be allowed to connect from the CMS address (the user’s host in MySQL)
SSL ModeDisabled (no TLS), Require TLS (no certificate validation), Verify CA or Verify CA and hostname. A new connection starts on Require TLS
CA certificate (PEM)Only for the modes that verify: the CA that signed the server certificate
Test Query (Keep Alive)Blank = SELECT 1
Allow retrieving the server’s public keyOnly shown with SSL disabled. See below

MySQL 8 without TLS. MySQL 8’s default login (caching_sha2_password) needs the server’s public key when the connection is not encrypted. Fetching it in clear lets anyone on the path read the password — that is why the option comes off and only shows up with SSL disabled. Prefer the Require TLS mode: MySQL 8 already ships with TLS on, with nothing to configure on the server.

Collection — MYSQL

The SELECT Query accepts :name parameters (Variables and Input Parameters), the Post-Collection Command marks the rows read with :ids, and the Result Mode chooses between one row per message or all in one message. The Test query button runs the editor’s query and shows a sample, without storing a message and without running the post-collection command.

-- SELECT Query SELECT id, ordem, quantidade FROM fila_producao WHERE processado = 0 AND planta = :PLANTA_PADRAO -- Post-Collection Command UPDATE fila_producao SET processado = 1 WHERE id IN (:ids)

How values arrive

Column typeHow it comes in the payload
DATE / DATETIMEAs stored, with no time zone — MySQL does not keep a time zone in these columns
TIMESTAMPIn UTC
Large BIGINT / DECIMALAs text, so no digit is lost

Delivery — MYSQL_EXEC

The SQL Command accepts INSERT, UPDATE, DELETE and REPLACE, with :payload, :datetime, :transformer, the Variables and the Input Parameters. All of them become driver parameters — never text concatenated into the command.

INSERT INTO recebimento (payload, recebido_em, planta) VALUES (:payload, :datetime, :PLANTA_PADRAO)

If a :name matches no Input Parameter, Variable or message value, the execution fails saying which placeholder was left without a value.

Vocabulary blocked in this dialect

On top of the DDL/DCL barred in every dialect and of more than one command per field, this one blocks:

LOAD_FILE, INTO OUTFILE, INTO DUMPFILE, LOAD DATA, SLEEP, BENCHMARK, KILL, SHUTDOWN, PREPARE, INSTALL/UNINSTALL, CALL

The executable comment /*! ... */ is also refused: MySQL runs what is inside it, so it would be a way to hide a command from the guard.

The full check is described in what CMS blocks in SQL fields.

Catalog

The connection’s View catalog browses the tables and columns, with the primary key. The wizard that generates a Collection and a Delivery from the catalog and the UNS Historian destination are not yet available for MySQL.

Common errors

MessageLikely cause
“MySQL refused the credentials”Wrong user or password — or the user is not allowed to log in from the CMS address
“The user has no access to database …”Missing GRANT on the configured database
“Database … does not exist on the server”Wrong database name
“The server requires an encrypted connection”The server has require_secure_transport: choose an SSL mode other than disabled
“MySQL 8 asks for the server’s public key to authenticate without TLS”Use Require TLS, or turn on Allow retrieving the server’s public key
“The MySQL TLS certificate could not be validated”Paste the CA into CA certificate, or use Require TLS
“Could not connect to MySQL”Host, port, firewall or the user’s allowed host
“Placeholder … does not match any Input Parameter …”:name with no value in the message, Input Parameters or Variables

Testing in the Test Bench

In the Test Bench, the Delivery’s Dry run mode shows the command with the values in place of the placeholders, without running anything on the database. On the Collection, the form’s own Test query plays that role.