Rabu, 18 Januari 2017

MySQL Error #1055





When i deploy an application i have several problem with mysqlserver, i have error message "#1055 - Expression of SELECT list is not in GROUP BY clause and contains non aggregated column this is incompatible with sql_mode=only_full_group_by"

after search several time i have a solution, the solution is to disable the only_full_group_by setting on mysql server;

Method one :
You can disable the only_full_group_by by login to mysql server and execute this command;

mysql> set global 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> set session sql_mode='STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION';


or you can edit /etc/mysql/conf.d/mysql.cnf

[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

after execute the command or change configuration file then restart mysqlserver service.


~~Thanks~~



0 komentar:

Posting Komentar