Home  >  Article  >  Database  >  (转)Timezone fun with MySQL and UTC_MySQL

(转)Timezone fun with MySQL and UTC_MySQL

WBOY
WBOYOriginal
2016-06-01 13:11:001126browse


shell> mysql_tzinfo_to_sql /usr/share/zoneinfo | mysql -u root -p mysql

REVO首页打不开,提示说timezone问题,“Fatal error: Uncaught exception 'Zend_Db_Statement_Exception' with message 'SQLSTATE[HY000]: General error: 1298 Unknown or incorrect time zone: 'UTC'”


由于mysql按照服务器系统时间, 而php按照UTC时间,所以导致不一致,因此要将mysql的时区设置为UTC,用以上命令搞定。


Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn