replication - MySQL : Timestamps replicating inconsistently depending on local timezone of server? -
can explain mysql 5.5 handling of replication between 2 servers.
this structure of 1 of table.
id int(10) unsigned not null primary key default 'null' auto_increment kot_no varchar(45) not null default 'null' emp_id int(10) unsigned not null foreign key default '0' description varchar(45) null default 'null' created_date timestamp not null default '0000-00-00 00:00:00' created_by int(10) unsigned not null default '0' modified_date timestamp not null default 'current_timestamp on update current_timestamp' modified_by int(10) unsigned null default '0' state tinyint(1) unsigned not null default '1'
in database every table has last 5 columns , binlog format statement based replication
when i'm executing insert kot (kot_no, emp_id, created_date) values (1, 1, now())
on server these results on 2 servers.
on server a
id kot_no emp_id description created_date created_by modified_date modified_by state 1 1 1 null 2015-11-01 22:51:57 0 2015-11-01 22:51:57 0 1
on server b
id kot_no emp_id description created_date created_by modified_date modified_by state 1 1 1 null 2015-11-02 12:21:57 0 2015-11-02 12:21:57 0 1
i had naively assumed dates stored in utc in database , effect of localtime display purposes? can shed light on what's happening here , tell me solution without affecting server data?
problem mysql timezone
different in both server
check timezone query :-
select @@global.time_zone;
or can set timezone :-
set global time_zone = '+8:00';//your timezone set global time_zone = 'europe/helsinki';////your timezone set @@global.time_zone='+00:00';////your timezone
Comments
Post a Comment