Sometime you will face some weird error in mysql that you have never seen. It can be probably because of mysql mode. Mostly it’s because of mysql strict mode.
checking mysql mode
$ SELECT @@GLOBAL.sql_mode;
setting mysql mode
$ SET GLOBAL sql_mode = 'STRICT_ALL_TABLES';
But these setting will only effect in current session. After you have restart mysql, it will just get back to default setting defined in my.cnf
For this case, you have to change in my.cnf . If you don’t know where is my.cnf exist. you can use that command.
find / -name "my.cnf"
and edit my.cnf with your favourite editor
usually i didn’t set any mysql mode, just blank
sql-mode = " "
Hope it help and you can see all modes in mysql official site
Happy Coding !