php-SQLSTATE [42000]:语法错误或访问冲突:1055
作者:互联网
我正在使用Laravel 5.5我添加了此依赖关系以简化搜索引擎
https://github.com/nicolaslopezj/searchable
但是当我尝试搜索任何东西时遇到问题
SQLSTATE[42000]: Syntax error or access violation: 1055 'myreview.movies.name' isn't in GROUP BY (SQL: select count() as aggregate from (select movies., max((case when LOWER(movies.name) LIKE car then 150 else 0 end) + (case when LOWER(movies.name) LIKE car% then 50 else 0 end) + (case when LOWER(movies.name) LIKE %car% then 10 else 0 end) + (case when LOWER(movies.description) LIKE car then 150 else 0 end) + (case when LOWER(movies.description) LIKE car% then 50 else 0 end)
我已经尝试过更改mysql数据库
更改为mysql 5.7后我正在使用mariadb 10.2
但是我的cpanel服务器上有mariadb
帮我考虑一下
谢谢
解决方法:
>打开config / database.php
>严格将值从true更改为false
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'strict' => false,
'engine' => null,
],
>保存
您可以在我的帖子中完整阅读=> How to Fix SQLSTATE[42000]: Syntax error or access violation: 1055
标签:laravel-5-5,laravel,mysql,php 来源: https://codeday.me/bug/20191025/1928993.html