我有这个 sql_mode 的问题
SQLSTATE[42000]: Syntax error or access violation:
1055 Expression #1 of SELECT list is not in GROUP BY clause and contains nonaggregated
column 'my_database_name.my_table.id' which is not functionally dependent on columns
in GROUP BY clause; this is incompatible with sql_mode=only_full_group_by
我尝试了本教程,但没有结果。 如何摆脱 MySQL 中的 STRICT SQL 模式
我有一个干净的 osX 10.11 安装,我在本教程中手动安装了 apache、php 和 mysql ... https://coolestguidesontheplanet.com/get-apache-mysql-php-and-phpmyadmin-working-on-osx -10-11-el-capitan/
我的版本阿帕奇:
$ httpd -v
Server version: Apache/2.4.18 (Unix)
Server built: Feb 20 2016 20:03:19
mysql版本:
Server version: 5.7.11 MySQL Community Server (GPL)
如果我首先将此 sql 代码插入到我的 phpmyadmin 中,那么一切正常,下次重新启动 os 或 mysql
SET GLOBAL sql_mode = 'NO_ENGINE_SUBSTITUTION';
我尝试在每个路径中设置 my.cnf 文件,如下所示,重启后仍然是同样的问题。
$ mysql --help | grep /my
/etc/my.cnf /etc/mysql/my.cnf /usr/local/mysql/etc/my.cnf ~/.my.cnf
请帮忙。谢谢