Why i cannot able to set "SESSSION TIMEZONE" while configuring MySQL database in Grafana database?

Hi Grafana team and community members,

What Grafana version and what operating system are you using?
Grafana v10.1.5 and it is running on Windows 11.

What are you trying to achieve?
→ I am trying to connect MySQL database(running at IST(UTC+05:30) to Grafana

What worked correctly and what caused problem?
→ I was successful in connecting MySQL database if i left the “SESSION TIMEZONE” field as it is. However, if i try to set “SESSION TIMEZONE” as ‘Asia/Kolkata’ as MySQL database is running in IST(UTC+05:30), then i received the error[It inform us to check the logs].

=>But I checked the logs where it says ‘datasource not found’ which is wrong,


Image-2[Connection failed]
Screenshot 2023-12-23 214048

Image-3[log image]

Why are you trying to do that?

Because SQL database is running at ‘UTC+05:30’.

It doesn’t matter where, or in which timezone, your SQL database is running -
the timestamps in its database tables should be in UTC.

It is up to any application which reads those timestamps to display them in
whatever local timezone is appropriate.

If you do not do this (store timestamps in UTC) then you will encounter
problems at the very least when summertime and wintertime representations of
“local time” change, and suggest either that “02:30 today does not exist” or
“02:30 today happened twice”.

So, if your database tables contain timestamps in anything other than UTC,
that is what needs to be fixed.

You will find that everything else sorts itself out neatly after that.


1 Like