Categories: Solutions

How to solve Invalid default value for ‘created_at’ while adding new column in database.

[Problem:]
While adding new column to the table by alter method, I used this sql code

 

ALTER TABLE investments ADD bank TEXT;
ERROR 1067 (42000): Invalid default value for ‘created_at’

 

But An eeror came thought I tried various data type
ERROR 1067 (42000): Invalid default value for ‘created_at’

 

[solution]
The problem in my database is current mode is in the sql_mode

 

SO, in the sql I typed and hit the commend
set global sql_mode = 'ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';

 

 

and it solved the problem.
jaminrai

Recent Posts

Class XII | Assignment 2 ( C Structure)

STRUCTURE (Submit after Mid Term , 15 Ashad 2083) A) MCQ 1. What is the…

2 days ago

Class XII Assignment 1 ( C Function )

FUNCTION (Assignment) Submit Before Mid Term MCQ 1. What is the output of this statement…

2 days ago

Evolution History of computer Technology

Evolution History of computer Technology (HISTORY OF COMPUTER) Evolution of computer is a study of…

4 weeks ago

Maturity of Enterprise Architecture Practice

Maturity of Enterprise Architecture Practice Maturity of Enterprise Architecture Practice   DOWNLOAD

2 months ago