Since a Mariadb update, every field in my databases requires a default value.

Discussion in 'MySQL' started by marcel, Sep 28, 2018.

  1. #1
    Since a Mariadb update, every field in my databases requires a default value.

    A simple insert or update generates this error.

    error msg: Field 'publicfileid' doesn't have a default value.

    Anyone seen and solved this before ?
     
    marcel, Sep 28, 2018 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    Most likely running in strict mode. look in your my.cnf/ini file and see if STRICT_TRANS_TABLES is set.
     
    jestep, Oct 4, 2018 IP
  3. SaleSmith

    SaleSmith Peon

    Messages:
    24
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    1
    #3
    Also you can execute a command:
    SET GLOBAL sql_mode='';
    Code (SQL):
    But after reboot, you need execute this command again.
    The best solution is remove "STRICT_TRANS_TABLES" from "sql-mode" variable in file "my.cnf".
     
    SaleSmith, Oct 6, 2018 IP