MySQL 错误: BY clause; this is incompatible with sql_mode=only_full_group_by

  1. sudo vim /etc/mysql/my.cnf
  2. 在文件底部粘贴下面代码:
[mysqld]
sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION'
  1. 保存退出 vim
  2. 重启 MySQL: sudo service mysql restart

你可能感兴趣的:(MySQL 错误: BY clause; this is incompatible with sql_mode=only_full_group_by)