mysql 1055报错

问题描述:

错误位置
FILE: /data/www/syhuo.net/ThinkPHP/Library/Think/Db/Driver.class.php  LINE: 350
1055:Expression #3 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'zhihuo.Device.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by [ SQL语句 ] : SELECT Channel.name AS name,Channel.mem_id AS channel_id,Device.id AS id,COUNT(online_status) AS total,COUNT(last_con_time) AS recent FROM zh_channel Channel LEFT JOIN zh_device Device ON Channel.mem_id = Device.channel_id LEFT JOIN zh_device_info DeviceInfo ON Device.id = DeviceInfo.dev_id GROUP BY mem_id ORDER BY `mem_id` DESC LIMIT 0,20
[root@shengyihuo01 ~]# vim /etc/my.cnf
sql_mode = ''
symbolic-links=0
bind-address = 127.0.0.1
federated
[root@shengyihuo01 ~]# service mysqld restart

猜你喜欢

转载自www.cnblogs.com/hnhycnlc888/p/12192767.html