Run this query - this work for a session
SET sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION';
best way is to set in mysql .cnf files
$ sudo vi /etc/mysql/mysql.conf.d/mysqld.cnf
Below [mysqld] section add sql_mode command Example:
[mysqld]
sql_mode = 'STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'
Then validate config
sudo mysqld --validate-config
OR
sudo mysqld --defaults-file=/etc/mysql/my.cnf --validate-config
No output, then everything good.
Then
sudo service mysql restart
No comments:
Post a Comment