<tfoot id='tN6RS'></tfoot>

<small id='tN6RS'></small><noframes id='tN6RS'>

    • <bdo id='tN6RS'></bdo><ul id='tN6RS'></ul>
    <legend id='tN6RS'><style id='tN6RS'><dir id='tN6RS'><q id='tN6RS'></q></dir></style></legend>

      <i id='tN6RS'><tr id='tN6RS'><dt id='tN6RS'><q id='tN6RS'><span id='tN6RS'><b id='tN6RS'><form id='tN6RS'><ins id='tN6RS'></ins><ul id='tN6RS'></ul><sub id='tN6RS'></sub></form><legend id='tN6RS'></legend><bdo id='tN6RS'><pre id='tN6RS'><center id='tN6RS'></center></pre></bdo></b><th id='tN6RS'></th></span></q></dt></tr></i><div id='tN6RS'><tfoot id='tN6RS'></tfoot><dl id='tN6RS'><fieldset id='tN6RS'></fieldset></dl></div>
    1. MYSQL 不正确的 DATETIME 格式

      时间:2023-05-31

          <tbody id='08ZGd'></tbody>

          <i id='08ZGd'><tr id='08ZGd'><dt id='08ZGd'><q id='08ZGd'><span id='08ZGd'><b id='08ZGd'><form id='08ZGd'><ins id='08ZGd'></ins><ul id='08ZGd'></ul><sub id='08ZGd'></sub></form><legend id='08ZGd'></legend><bdo id='08ZGd'><pre id='08ZGd'><center id='08ZGd'></center></pre></bdo></b><th id='08ZGd'></th></span></q></dt></tr></i><div id='08ZGd'><tfoot id='08ZGd'></tfoot><dl id='08ZGd'><fieldset id='08ZGd'></fieldset></dl></div>
          <tfoot id='08ZGd'></tfoot>

          <small id='08ZGd'></small><noframes id='08ZGd'>

            • <bdo id='08ZGd'></bdo><ul id='08ZGd'></ul>
            • <legend id='08ZGd'><style id='08ZGd'><dir id='08ZGd'><q id='08ZGd'></q></dir></style></legend>

                本文介绍了MYSQL 不正确的 DATETIME 格式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                问题描述

                我有一个带有 Doctrine 1 的应用程序,我通过 new Zend_Date->getIso() 为对象生成 update_datetime 字段.多年来它一直运行良好,但现在我有了一个新笔记本,Doctrine 尝试将 DATETIME 字段作为字符串插入 "2013-07-12T03:00:00+07:00" 而不是正常的 MySQL 日期时间格式 "2013-07-12 00:00:00" 这完全是奇怪的.

                I have an app with Doctrine 1 and I generate update_datetime fields for objects via new Zend_Date->getIso(). It worked just fine for years, but now I got a new notebook and Doctrine tries to insert a DATETIME fields as a string "2013-07-12T03:00:00+07:00" instead of normal MySQL datetime format "2013-07-12 00:00:00" which is totally weird.

                完全相同的代码在另一台计算机上运行得很好.一切都几乎相同——两者都是 MySQL 5.6.12、PHP 5.3.15.知道我应该去哪里看吗?

                The very same code runs just fine on another computer. Everything is nearly identical – MySQL 5.6.12, PHP 5.3.15 on both. Any idea where should I look?

                致命错误:未捕获的异常 'Doctrine_Connection_Mysql_Exception' 带有消息 'SQLSTATE[22007]:无效的日期时间格式:1292 不正确的日期时间值:'2013-07-12T03:00:00+07:00' 列'nextrun''在第 1 行'在 library/Doctrine/Connection.php:1083

                更新

                好的,在 StackOverflow 社区的帮助下,我终于解决了.问题在于 sql_mode 变量中的 STRICT_TRANS_TABLES.但是在 /etc/my.cnf 中更改它似乎还不够,所以我必须运行 mysql -uroot 并键入以下内容:

                Ok with the help from StackOverflow community I finally solved it. The problem was with STRICT_TRANS_TABLES in sql_mode variable. But changing it in /etc/my.cnf seemed not enough, so I had to run mysql -uroot and type the following:

                set sql_mode=NO_ENGINE_SUBSTITUTION;设置全局 sql_mode=NO_ENGINE_SUBSTITUTION;

                从而删除STRICT_TRANS_TABLES

                更新2如何永远摆脱 STRICT?如何摆脱 MySQL 中的 STRICT SQL 模式

                UPDATE2 How to get rid of STRICT forever? How to get rid of STRICT SQL mode in MySQL

                推荐答案

                如果存在,您可以尝试从 my.ini 中的 sql-mode 中删除 STRICT_TRANS_TABLES.

                If it exists, you can try removing STRICT_TRANS_TABLES from sql-mode in your my.ini.

                这可能会导致此错误,日期时间字符串值包含您尚未转换为 mysql 日期时间的格式.将此 my.ini 更改报告为以下位置的修复:

                This can cause this error with a datetime string value containing the format you have not being converted to mysql datetime. This my.ini change was reported as a fix in:

                • PING 导致 500 内部服务器错误 - 日期时间值不正确(AuthPuppy 错误 #907203)
                • PING causes 500 Internal Server Error - Incorrect datetime value (AuthPuppy Bug #907203)

                这篇关于MYSQL 不正确的 DATETIME 格式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                上一篇:PHP:将数据从服务器推送到客户端的最佳方式......? 下一篇:Zend_Test_PHPUnit_Constraint_DomQuery::evaluate() 的声明应该与 PHP

                相关文章

                <i id='FvXGI'><tr id='FvXGI'><dt id='FvXGI'><q id='FvXGI'><span id='FvXGI'><b id='FvXGI'><form id='FvXGI'><ins id='FvXGI'></ins><ul id='FvXGI'></ul><sub id='FvXGI'></sub></form><legend id='FvXGI'></legend><bdo id='FvXGI'><pre id='FvXGI'><center id='FvXGI'></center></pre></bdo></b><th id='FvXGI'></th></span></q></dt></tr></i><div id='FvXGI'><tfoot id='FvXGI'></tfoot><dl id='FvXGI'><fieldset id='FvXGI'></fieldset></dl></div>

                • <bdo id='FvXGI'></bdo><ul id='FvXGI'></ul>

                  <tfoot id='FvXGI'></tfoot>

                    <legend id='FvXGI'><style id='FvXGI'><dir id='FvXGI'><q id='FvXGI'></q></dir></style></legend>
                  1. <small id='FvXGI'></small><noframes id='FvXGI'>