Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change mysql timezone to UTC from EDT time

Tags:

timezone

mysql

I have installed mysql in my linux server. My server timezone is UTC but mysql timezone in EDT. Now i want to change mysql timezone to UTC.

when i run date in linux command, it shows Fri Nov 6 09:25:01 UTC 2015

when i run select now() in mysql,it shows 2015-11-06 04:25:26.

So how to change EDT to UTC in mysql.

Note : i m using mysql workbench.

like image 422
MMMMS Avatar asked Dec 29 '25 20:12

MMMMS


1 Answers

Set you MySQL timezone :-

SET GLOBAL time_zone = '+8:00';
SET GLOBAL time_zone = 'Europe/Helsinki';
SET @@global.time_zone='+00:00';

For check timezone :-

SELECT @@session.time_zone;

location of MySQL configuration file :-

/etc/mysql/my.cnf
like image 189
Abhishek Sharma Avatar answered Jan 01 '26 10:01

Abhishek Sharma