MariaDB Overview
TheMARIADB route stores MQTT messages in MariaDB databases. MariaDB is a MySQL-compatible database with enhanced features and performance optimizations.
MariaDB offers drop-in MySQL compatibility with additional features like improved replication and storage engines. Use the same configuration as MySQL with the
MARIADB route type.Basic Syntax
Connection Configuration
SQL_CONFIG Parameters
MariaDB server hostname or IP address.
Target database name.
Database username.
Database password.
Writing Data
- Basic Storage
- With SSL
- UPSERT
- UPDATE
- DELETE
Store sensor data in MariaDB:
Alternative: STORE IN with Models — Instead of writing EVENT queries, you can bind a model directly to this route. Every See Data Storage Overview for the full STORE IN workflow.
PUBLISH MODEL call automatically inserts a row — no query needed:Reading Data
EVENTs also support SELECT queries to read data back from the database. Publish a message to the event’sSOURCE_TOPIC, and the query result is published to DESTINATION_TOPIC:
db/result/latest, where your actions or external clients can consume it.
Timed Polling
EVENTs can also run SELECT queries on a fixed schedule usingWITH EVERY:
Troubleshooting
Connection Refused
Connection Refused
- Verify SERVER and PORT are correct
- Check MariaDB is running and accepting connections
- Verify firewall allows connections on port 3306
Authentication Failed
Authentication Failed
- Verify USERNAME and PASSWORD are correct
- Check user has permissions on the DATABASE
- Verify user can connect from your host
Next Steps
Data Storage Routes Overview
Compare all storage options.
SQL Server Route
Configure Microsoft SQL Server storage.

