Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

群打卡sql错误 #148

Closed
sforce100 opened this issue Aug 24, 2021 · 1 comment
Closed

群打卡sql错误 #148

sforce100 opened this issue Aug 24, 2021 · 1 comment

Comments

@sforce100
Copy link

我用的环境

  • PHP 版本:7.4
  • MoChat 版本:1.0 最新
  • Swoole 版本:

问题及现象

{"@timestamp":"2021-08-24T14:09:32.295530+08:00","@Version":1,"host":"442901984fb7","message":"SQLSTATE[42000]: Syntax error or access violation: 1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'mochat_v1.mc_room_clock_in_contact.id' which is not functionally dependent on columns in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by (SQL: select id, nickname, avatar, total_day, series_day from mc_room_clock_in_contact where clock_in_id = 1 and total_day > 0 and mc_room_clock_in_contact.deleted_at is null group by union_id, total_day order by total_day desc limit 10)[1082] in /opt/www/vendor/hyperf/database/src/Connection.php","type":"mochat","channel":"sys","level":"ERROR","monolog_level":400}

@maxincai
Copy link
Contributor

修改 MySQL 的配置文件,例如 /etc/my.cnf
修改其中的ONLY_FULL_GROUP_BY

sql_mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION

重启MySQL 即可

@maxincai maxincai closed this as completed Sep 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants