Changing the Timezone of a DB System

You can change the timezone of the current session of a DB system. When you restart a session, the timezone reverts to the value you specify in the configuration of the DB system.

To change the timezone of a DB system completely, update the configuration of the DB system with a new configuration that contains the required time_zone value. See Editing a DB System.

Using a Command-Line Client

Use a command-line client such as MySQL Client or MySQL Shell to change the timezone of a DB system.

  1. Connect to your DB system using a command-line client, and run the following command in the SQL execution mode:
    set time_zone='<TimezoneName>';
    You can specify the following in <TimezoneName>:
    • Any timezone such as GMT, HST, and PST. The default timezone is UTC.
    • Timezone in the following format: GMT+7:00, PST-4.00, -7:00 , and +3:00.
  2. (Optional) To view the global and session time_zone values, run the following command:
    SELECT @@GLOBAL.time_zone, @@SESSION.time_zone;
    You get a response similar to the following:
    +--------------------+---------------------+
    | @@GLOBAL.time_zone | @@SESSION.time_zone |
    +--------------------+---------------------+
    | UTC                | UTC                 |
    +--------------------+---------------------+