ubuntu mysql设置sql_mode

由于mysql从5.6升级到mysql5.7报错:

this is incompatible with sql_mode=only_full_group_by

系统环境 ubuntu16.04

解决方案:

  /etc/mysql/mysql.conf.d/mysqld.cnf里面加上

  sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'

重启mysql: service mysql restart

参考:在Ubuntu/Linux环境下使用MySQL:修改数据库sql_mode,可解决“this is incompatible with sql_mode=only_full_group_by”问题_女儿控老徐的专栏-CSDN博客

  

原文地址:https://www.cnblogs.com/yangfei123/p/14958792.html