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

Computer Science Project Report Guidelines and Sample

Guidelines (Click Below to Download) SAMPLE 1 SAMPLE 2

5 months ago

Skype Closes Its Doors After 20 Years: A Look Back and the Apps That Faded with It

After 20 years of transforming global communication, Skype has officially ceased operations. Microsoft, which purchased…

12 months ago

The Duck and the Tortoise: A Tale of Patience and Teamwork

In a serene forest by the edge of a sparkling lake, there lived a cheerful…

1 year ago