永久解决办法,重启任然生效
1.登录linux服务器
2.找到my.cnf 文件
3.vim /etc/my.cnf
分别在[mysqld]和[mysql]下面添加这段 sql_mode=STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
4.重启mysql /usr/local/mysql/support-files/mysql.server restart