Invalid default value for 'created_date' bei Import

  • Hallo,


    seit dem Update auf i-MSCP 1.5.1 kann ich keine .SQL Dateien mehr in PhpMyAdmin importieren. Ich mache es immer über SSH mit folgendem Befehl: mysql -h localhost -uUSERNAME -pPASSWORT DBNAME < /pfad/zur/sql/datei.sql


    Wenn ich den Befehl jetzt eingebe, erhalte ich nach kurzer Zeit folgende Fehlermeldung: ERROR 1067 (42000) at line 155636: Invalid default value for 'created_date'

    Es hat vorher immer problemlos funktioniert.


    Habe schon gegoogelt aber keine Lösung gefunden. Ich hoffe hier kann mir jemand helfen. :)


    Linux Distro: Debian Jessie
    i-MSCP Version: 1.5.1
    PhpMyAdmin Version: 4.7.4


    MfG

  • @sash456

    • SQL version and vendor?
    • Database schema (table that holds the created_date field)?
    • Data (insert) sample for your created_date field?
    • Result of the following SQL statement: SELECT @@GLOBAL.sql_mode; ?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • mysql Ver 14.14 Distrib 5.7.19


    SELECT @@GLOBAL.sql_mode; = ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION


    Quote

    Database schema (table that contain the created_date field)?
    Data (insert) sample for your created_date field?


    Ich habe die komplette Datenbank durchsucht aber finde kein created_date Feld.


    Die Datenbank ist immer die selbe die ich importiere und es hat immer funktioniert. Es sind keine unterschiedliche Dumps.

  • Ich habe die komplette Datenbank durchsucht aber finde kein created_date Feld.


    Wenn ich den Befehl jetzt eingebe, erhalte ich nach kurzer Zeit folgende Fehlermeldung: ERROR 1067 (42000) at line 155636: Invalid default value for 'created_date'

    That error which you mentioned in your previous post is not the result of a black magic ;) You have a schema with a wrong DEFAULT value for a datetime field.

    Die Datenbank ist immer die selbe die ich importiere und es hat immer funktioniert. Es sind keine unterschiedliche Dumps.

    Of course ;) That was because SQL modes were not so strict ;) As you can see in the result of the SQL statement I've asked you to execute, there are two SQL modes related to dates:

    How to switch back to old behavior


    Edit the /etc/mysql/conf.d/imscp.cnf file and leave the sql_mode parameter empty as follows: sql_mode =. Once done, restart your SQL server: service mysql restart


    Note that in i-MSCP version 1.5.2, the problem will be solved, according https://github.com/i-MSCP/imscp/blob/1.5.x/CHANGELOG#L83

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206

  • @sash456


    Any news?

    badge.php?id=1239063037&bid=2518&key=1747635596&format=png&z=547451206