Home > Database > Mysql Tutorial > body text

(转)Timezone fun with MySQL and UTC_MySQL

WBOY
Release: 2016-06-01 13:11:00
Original
1125 people have browsed it


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

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,用以上命令搞定。


source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template