fbpx

How to Disable Strict SQL Mode in MySQL 5.7

How to Disable Strict SQL Mode in MySQL 5.7

What is this error? “Database query failed: Data truncated for column ‘column_name’ at row 1
Your mysql might be running in strict mode. you need to disable it.
To disable strict SQL mode, SSH in to your server as root and create this file:

/etc/mysql/conf.d/disable_strict_mode.cnf

Open the file and enter these two lines:

[mysqld]
sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

 
Restart MySQL with this command:

sudo service mysql restart

 
 

Share this post