简体   繁体   中英

Ubuntu: SQL time is not the same as current OS timezone

Hey I tried to change my ubuntu timezone to UTC+2 and I did it. The timezone before was America/New-York and as I saw in forums SQL time must be the same as OS time, But nope.
When UTC+2 is 16:45 the SQL shows NY time (09:45)
Help is highly appreciated
Thank you very much!

It might be using cached timezone data. If you change the operating system timezone and have not restart the mysql service, it may use the previous timezone. Restart mysqld and run SELECT NOW(); to check.

sudo service mysql restart

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM