You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that timezone adaptions are done currently twice if the MySQL server time is set to the local timezone for TIMESTAMP columns. If the Unix timestamp is stored in an INT field, everything works correctly, as the MySQL does not perform any timezone convertions.
Possible solution would be to add time_zone=%27+00:00%27 to the connection string in
MySQL 5.7.25 with time_zone=SYSTEM on a non-UTC system.
What OS are you running grafana on?
official Docker Image (Linux)
What did you do?
What was the expected result?
What happened instead?
The text was updated successfully, but these errors were encountered:
xanonid
changed the title
Grafana seems to shift dates twice if MySQL server_time is set to local time instead of UTC
Grafana seems to shift timestamps twice if MySQL server_time is set to local time instead of UTC
Feb 8, 2019
Storing time in non-timezone aware format in MySQL and with non-UTC timezone of MySQL is not a supported use case in Grafana. Read #13769 for more information.
This fix in grafana/pkg/tsdb/mysql/mysql.go allowed me to get past this issue. In my case a timezone-naive Datetime field stored in UTC was getting mangled when grafana queried the unix_timestamp(column) and the mysql server time zone was SYSTEM. I believe the underlying issue is that grafana sets loc paramater in its connection string, but not time_zone:
It seems that timezone adaptions are done currently twice if the MySQL server time is set to the local timezone for TIMESTAMP columns. If the Unix timestamp is stored in an INT field, everything works correctly, as the MySQL does not perform any timezone convertions.
Possible solution would be to add
time_zone=%27+00:00%27
to the connection string ingrafana/pkg/tsdb/mysql/mysql.go
Line 28 in b32d420
What Grafana version are you using?
5.4.3
What datasource are you using?
MySQL 5.7.25 with time_zone=SYSTEM on a non-UTC system.
What OS are you running grafana on?
official Docker Image (Linux)
What did you do?
What was the expected result?
What happened instead?
The text was updated successfully, but these errors were encountered: