(轉)Timezone fun with MySQL and UTC


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'」 php


因爲mysql按照服務器系統時間, 而php按照UTC時間,因此致使不一致,所以要將mysql的時區設置爲UTC,用以上命令搞定。 mysql

相關文章
相關標籤/搜索