MySQL/MariaDB
The MySQL output module allows you to write data to a MySQL or MariaDB database server.
If your output parameters include a time parameter, these are recorded with a matching timestamp, creating a historical record of your data.
If you omit the time parameter, it will act like a simple key-value store, with the values being overwritten.
Parameter | Default | Meaning |
---|---|---|
host | localhost | The host name or IP address of the server |
user | The name of the database user | |
password | The database password | |
database | The name of the database | |
table | The name of the table to connect to | |
name | The name of the field to write the point name to | |
value | The name of the field to write the value to | |
time | The name of the field to write the time to (if any) |
Example (Key-Value)
[ { "type": "value", "method": "mysql", "host": "myserver", "user": "myuser", "password": "mypass", "database": "alertdb", "table": "alerts", "name": "code", "value": "status", "time": "stamp" } ]
The above example would connect to a MySQL/MariaDB server called 'myserver' and write to the alertdb database. When new values appear, they'd be written to the alerts table, with the point name in the code column and the value in the status column.
Other Modules
Return to the list of output modules.