phpVMS - 日期值不正确:' 0000-00-00'对于列' lastlogin'在第1行

时间:2017-08-07 00:00:52

标签: php mysql

我正在尝试安装一个名为phpVMS的软件,但是当我运行完设置后,我收到了一个错误 /var/www/fly/install/includes/Installer.class.php 278 Incorrect date value: '0000-00-00' for column 'lastlogin' at row 1 我查看了文件" Installer.class.php"我找不到日期值000-00-00。我该如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

在文件k = len(df) d = np.column_stack([df.planned_start.values, df.planned_end.values + 1]).ravel() i = np.tile([1, -1], k) a = d.argsort() f = np.arange(k).repeat(2) r = np.zeros(k, int) z = np.zeros(k, int) m = np.zeros(k, int) cumsum = 0 for j in range(f.size): x = f[a[j]] y = i[a[j]] r[x] = cumsum z[x] = (y + 1) // 2 r += y * z m = np.column_stack([m, r]).max(1) cumsum += y m array([5, 5, 5, 5, 5, 5, 4, 4]) 中更改以下行:

/install/sql/install.sql

`lastlogin` date NOT NULL DEFAULT '0000-00-00',

`lastupdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

`postdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - TABLE phpvms_pages.

`postdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', - TABLE phpvms_news.

`joindate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

`lastpirep` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

`submitdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',

在文件`lastlogin` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastupdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `postdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - TABLE phpvms_pages. `postdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, - TABLE phpvms_news. `joindate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `lastpirep` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, `submitdate` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP, 中更改以下两行:

/install/sql/structure.xml

<field Field="lastlogin" Type="date" Null="NO" Key="" Default="0000-00-00" Extra="" Comment="" />

<field Field="lastupdate" Type="datetime" Null="NO" Key="" Default="0000-00-00 00:00:00" Extra="" Comment="" />

<field Field="postdate" Type="datetime" Null="NO" Key="" Default="0000-00-00 00:00:00" Extra="" Comment="" /> - TABLE phpvms_pages.

<field Field="postdate" Type="datetime" Null="NO" Key="" Default="0000-00-00 00:00:00" Extra="" Comment="" /> - TABLE phpvms_news.

<field Field="joindate" Type="datetime" Null="NO" Key="" Default="0000-00-00 00:00:00" Extra="" Comment="" />

<field Field="lastpirep" Type="datetime" Null="NO" Key="" Default="0000-00-00 00:00:00" Extra="" Comment="" />

<field Field="submitdate" Type="datetime" Null="NO" Key="" Default="0000-00-00 00:00:00" Extra="" Comment="" />

再次安装。

  

MySQL 5.7.4通过包含更改使严格模式更严格   导致ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE和NO_ZERO_IN_DATE   一些问题。例如,在MySQL 5.6中使用严格模式但不是   启用NO_ZERO_DATE后,可以使用DEFAULT定义TIMESTAMP列   &#39; 0000-00-00 00:00:00&#39;在MySQL 5.7.4中使用相同的模式设置,   严格模式包括NO_ZERO_DATE和TIMESTAMP列的效果   不能用DEFAULT&#39; 00:00:00&#39;来定义。这导致   如果将CREATE TABLE语句从5.6复制到5.7.4则失败   它们包含TIMESTAMP列。

     

您可以将CURRENT_TIMESTAMP指定为TIMESTAMP和DATETIME列的默认值。