[mysql] ERROR 1067 (42000): Invalid default value for 'created_at'

  1. First, check existing mode(s) are using the following command in your terminal:

    $ mysql -u root -p -e "SHOW VARIABLES LIKE 'sql_mode';"

    or

    mysql> show variables like 'sql_mode';

    You would see an output like below

    enter image description here

  2. Disable mode(s) via my.cnf: In this case, you need to remove NO_ZERO_IN_DATE, NO_ZERO_DATE modes

    Open my.cnf file (Generally you could find my.cnf file located in /etc/my.cnf or /etc/mysql/my.cnf)

    Update modes in my.cnf under [mysqld] heading

    sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

    Here I have omitted NO_ZERO_IN_DATE, NO_ZERO_DATE modes

  3. Restart mysql server

    $ /etc/init.d/mysql restart