patternsqlMinor
My MySQL server time is not the same as my Server
Viewed 0 times
samethetimemysqlservernot
Problem
So a month ago I had purchased a server from a hosting company.
The info are;
Linux Centos (latest version).
I installed ZPanel which installs phpMyAdmin, MySQL and all the other good stuff. Anyway, I have managed to change my SERVER time to my local time which is GMT. However when I try to set it on my MySQL server it shows the right time, but when I use the
function in PHP, the time stores +1 hour ahead of my current time, which pretty much messes up my system.
Does anyone know how to fix this? Please It's been a few weeks, yet nothing to fix it :/
Thank you.
The info are;
Linux Centos (latest version).
I installed ZPanel which installs phpMyAdmin, MySQL and all the other good stuff. Anyway, I have managed to change my SERVER time to my local time which is GMT. However when I try to set it on my MySQL server it shows the right time, but when I use the
now()function in PHP, the time stores +1 hour ahead of my current time, which pretty much messes up my system.
Does anyone know how to fix this? Please It's been a few weeks, yet nothing to fix it :/
Thank you.
Solution
I had this exact same problem after I had updated my server time. I just had to restart the MySql server then it reset the time to match my server time.
Reference - https://major.io/2007/07/01/mysql-time-zone-different-from-system-time-zone/
/etc/init.d/mysqld restartReference - https://major.io/2007/07/01/mysql-time-zone-different-from-system-time-zone/
Code Snippets
/etc/init.d/mysqld restartContext
StackExchange Database Administrators Q#47539, answer score: 6
Revisions (0)
No revisions yet.