Open
Description
Describe the feature request
sqlite and postgres are both available as storage engines. In some environments, where a MySQL or MariaDB server already exists, it would be convenient to use a DB on this server.
Why do you personally want this feature to be implemented?
I have an environment with MySQL/MariaDB :)
How long have you been using this project?
Currently evaluating
Additional information
If there are no known technical blockers why it would not work, I'm happy to take a pass at implementing the support and send a PR. It looks like it should be fairly doable, and would be in the same style as the postgres/sqlite split.
Activity
[-]MariaDB/MySQL Support[/-][+]feat(storage): Add support for MariaDB/MySQL[/+]TwiN commentedon May 13, 2022
Sounds good to me!
It may be a bit tricky though, because IIRC, mysql/mariadb does not support the following:
INSERT INTO ... RETURNING <column_name>
INSERT INTO ... ON CONFLICT(...) DO UPDATE
mrmonkington commentedon Sep 27, 2022
Mariadb (not MySQL) has
RETURNING
since 10.5, though if you just want to get a new primary key back older versions and MySQL haveSELECT LAST_INSERT_ID()
which operates per session. (i.e. you are guaranteed to get the last new primary key generated on your current session)MySQL/MariaDB you have two options to do something similar:
REPLACE INTO
-> simpler if you just want to overwrite an old rowor
INSERT ... ON DUPLICATE KEY UPDATE
-> more flexible if you, e.g. want to increment a counterHTH!
[-]feat(storage): Add support for MariaDB/MySQL[/-][+]Add support for MariaDB/MySQL[/+]schealex commentedon Sep 23, 2024
any news on this?
TwiN commentedon Sep 24, 2024
@schealex I don't have time to personally work on a feature like this right now, but if you or anybody else are interested in trying to implement it, please don't hesitate.
devhaozi commentedon Feb 23, 2025
For someone here who want to test gatus with MySQL, you can use this docker image:
ihaozi/gatus:latest
.