I have a Grafana instance set to UTC. The data in a MySQL database is stored as a datetime (in UTC).
I have a query to obtain data using:
WHERE $__timeFilter(time) AND …
The MySQL database server is set to local time. So when the MySQL query executes, I retrieve data, but not the most recent 5/6 hours (I am in Central time), which corresponds to our UTC offset. From what I found in doing a search, the solution is to set the MySQL database time zone to UTC. Our center’s MySQL server is used by many others and unfortunately that isn’t an option.
I did find in MySQL you can set it for a session (e.g., SET @@session.time_zone = “+00:00”;), but my Grafana MySQL query doesn’t seem to let me do that command and then the query.
Is there a way to do two SQL commands within the Grafana dashboard or another way to resolve this time issue?