K
K
Khurshed Abdujalil2018-02-14 06:57:58
MySQL
Khurshed Abdujalil, 2018-02-14 06:57:58

How to set timezone in mysql?

Decided to set the timezone in mysql. added lines to my.cnf
[mysqld]
default-time-zone='+03:00'
But all the old data that was on the server also had dates (timestamp) shifted, which I would not like, can this problem be solved somehow? or as an option to change the type of timestamp to datetime?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Pavel Belyaev, 2018-02-14
@PavelBelyaev

when connecting to the database
SET @@session.time_zone = "+00:00";

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question