MySQL 5.1 リファレンスマニュアル :: B Errors, Error Codes, and Common Problems :: B.1 Problems and Common Errors :: B.1.4 Administration-Related Issues :: B.1.4.6 Time Zone Problems
« B.1.4.5 How to Protect or Change the MySQL Unix Socket File

B.1.5 Query-Related Issues »
Section Navigation      [Toggle]
  • B.1.4 Administration-Related Issues
  • B.1.4.1 How to Reset the Root Password
  • B.1.4.2 What to Do If MySQL Keeps Crashing
  • B.1.4.3 How MySQL Handles a Full Disk
  • B.1.4.4 Where MySQL Stores Temporary Files
  • B.1.4.5 How to Protect or Change the MySQL Unix Socket File
  • B.1.4.6 Time Zone Problems

B.1.4.6. Time Zone Problems

If you have a problem with SELECT NOW() returning values in UTC and not your local time, you have to tell the server your current time zone. The same applies if UNIX_TIMESTAMP() returns the wrong value. This should be done for the environment in which the server runs; for example, in mysqld_safe or mysql.server. See 項2.14. 「環境変数」.

You can set the time zone for the server with the --timezone=timezone_name option to mysqld_safe. You can also set it by setting the TZ environment variable before you start mysqld.

The allowable values for --timezone or TZ are system-dependent. Consult your operating system documentation to see what values are acceptable.

Copyright © 1997, 2010, Oracle and/or its affiliates. All rights reserved. Legal Notices
Top / Previous / Next / Up / Table of Contents
© 2010, Oracle Corporation and/or its affiliates