Problem:
I installed mysql DB 5.7.19 on my ubuntu server by default. After that, my all PHP projects that used queries with “Insert into integer with value ”” got errors like this:
Error: SQLSTATE[HY000]: General error: 1366 Incorrect integer value: ” for column
Solution 1
Temporary solution is to execute query:
SET @@GLOBAL.sql_mode= 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';
or with CLI MODE
mysql -u root -p -e "SET @@GLOBAL.sql_mode= 'NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';"
Solution 2
Configure your mysql server. Add this:
[mysqld] sql_mode = NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
to one of those files:
/etc/mysql/my.cnf
orĀ /etc/mysql/conf.d/mysql.cnf
every time i have to run this command in my system or any another option is avable
You can add it to configuration of mysql. View solution 2