我已经创建了一个项目,我想开始使用 laravel sail 进行本地开发,但是当我启动容器时,sail up --buildmysql 容器中出现错误,并显示以下完整输出:
merkat-db | 2021-01-14T16:34:34.729905Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
redis_1 | 1:M 14 Jan 2021 16:34:34.340 * Running mode=standalone, port=6379.
redis_1 | 1:M 14 Jan 2021 16:34:34.340 # Server initialized
redis_1 | 1:M 14 Jan 2021 16:34:34.340 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command …Run Code Online (Sandbox Code Playgroud) 我正在尝试使用 queryBuilder 获取一张表中的所有结果,按 15 个字段分组分页。
$data['invoices'] = InvoiceModel::selectRaw("*")
->groupBy('serie')
->paginate(15);
Run Code Online (Sandbox Code Playgroud)
Laravel 抛出以下错误:
SQLSTATE[42000]:语法错误或访问冲突:1055 SELECT 列表的表达式 #1 不在 GROUP BY 子句中,并且包含非聚合列“projetoservidor.vendas_195295269.id”,该列在功能上不依赖于 GROUP BY 子句中的列;这与 sql_mode=only_full_group_by 不兼容(SQL: select count(*) asaggregate from (select * from vendas_195295269group by serie) as aggregate_table)
我应该怎么办?