Skip to content

Instantly share code, notes, and snippets.

@r17x
Created March 6, 2018 08:36
Show Gist options
  • Select an option

  • Save r17x/734cab981731e8be705d6e1652c79110 to your computer and use it in GitHub Desktop.

Select an option

Save r17x/734cab981731e8be705d6e1652c79110 to your computer and use it in GitHub Desktop.
#Example Problem:
Expression #9 of SELECT list is not in GROUP BY clause and contains nonaggregated column 
'table.column' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
#Solved With:
use your_db;
SET sql_mode = '' ;
#or
SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY',''));
#or config mysql service 
$ sudo vim /etc/mysql/conf.d/mysql.cnf
[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
$ save..
$ sudo service mysql restart || sudo service mysql-server restart 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment