The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Database time not matching server time

Discussion in 'Database Discussions' started by Todd23, Mar 16, 2017.

  1. Todd23

    Todd23 Registered

    Joined:
    Mar 16, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    home
    cPanel Access Level:
    Root Administrator
    I recently updated EA 3 to EA 4
    in whm the server time is set to eastern.
    the database time however is still set to utc time
    How can this be fixed?
     
  2. kernow

    kernow Well-Known Member

    Joined:
    Jul 23, 2004
    Messages:
    899
    Likes Received:
    13
    Trophy Points:
    168
    cPanel Access Level:
    Root Administrator
    You can add an entry to your /etc/my.cnf file. Example, say your -6 hours GMT/UTC add this to your my.cnf
    Code:
    default-time-zone = '-06:00'
    You will need to restart MySQL after making the change. Confirm with this command:
    Code:
    mysql -e "SELECT NOW();"
    which will show something like:
    Code:
    +---------------------+
    
    | NOW()               |
    
    +---------------------+
    
    | 2017-03-16 20:57:31 |
    
    +---------------------+
     
    #2 kernow, Mar 16, 2017
    Last edited: Mar 16, 2017
  3. Todd23

    Todd23 Registered

    Joined:
    Mar 16, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    home
    cPanel Access Level:
    Root Administrator
    That may work, however when the fall comes and the time changes that -6 becomes -7 and then things are out of sync again.
     
  4. Todd23

    Todd23 Registered

    Joined:
    Mar 16, 2017
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    home
    cPanel Access Level:
    Root Administrator
    Thanks for the suggestion. without making any more changes I restarted mysql a couple time and it fixed itself.
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    37,163
    Likes Received:
    1,294
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    I'm happy to see the issue is now fixed. Thank you for updating us with the outcome.
     
Loading...

Share This Page