Page 1 of 1

SELECT list is not in GROUP BY...sql_mode=only_full_group_by

PostPosted: 16 Dec 2018, 10:31
by support
After installing Open Real Estate you may encounter the following error:
CDbException: SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by

Try to delete ONLY_FULL_GROUP_BY setting if you have access to mysql console
For example:
Code: Select all
mysql > SET GLOBAL sql_mode=(SELECT REPLACE(@@sql_mode,'ONLY_FULL_GROUP_BY','')); 



If you don't have access to mysql console:
open file protected\config\db.php and before the line:
Code: Select all
'class' => 'CDbConnection'

add:
Code: Select all
'initSQLs' => array("SET SESSION sql_mode='TRADITIONAL';"