1

I issue the following command on the server:

> date
Mon Mar  9 08:16:02 EDT 2015

Then I log into mysql and type the following:

SELECT @@SYSTEM_TIME_ZONE, @@TIME_ZONE, NOW();

Result:

+--------------------+-------------+---------------------+
| @@SYSTEM_TIME_ZONE | @@TIME_ZONE | NOW()               |
+--------------------+-------------+---------------------+
| EST                | SYSTEM      | 2015-03-09 02:10:00 |
+--------------------+-------------+---------------------+

How can I set the time to be correct?

EDIT: It is not just the hours that is off it is also minutes too.

AllisonC
  • 2,973
  • 4
  • 29
  • 46

2 Answers2

1

In your /etc/mysql/mysql.conf or wherever it is, check out the default-time-zone

Reference

Community
  • 1
  • 1
Sarath
  • 2,318
  • 1
  • 12
  • 24
0

The server date/time was off and mysql was using that as the value. I changed it using the following command:

date -s 'YYYY-MM-DD HH:MM-SS'

Example:

date -s '2015-04-22 10:12-00'

To verify, go into mysql and type:

SELECT NOW()
AllisonC
  • 2,973
  • 4
  • 29
  • 46