本文主要是介绍larvel 出现ONLY_FULL_GROUP_BY SQL提示,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
1:mysql5.7需要sql_mode的值为:STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
2:修改config/databases.php中mysql的strict
‘mysql’ => [
‘driver’ => ‘mysql’,
‘host’ => env(‘DB_HOST’, ‘’),
‘port’ => env(‘DB_PORT’, ‘’),
‘database’ => env(‘DB_DATABASE’, ‘’),
‘username’ => env(‘DB_USERNAME’, ‘’),
‘password’ => env(‘DB_PASSWORD’, ‘’),
‘unix_socket’ => env(‘DB_SOCKET’, ‘’),
‘charset’ => ‘utf8mb4’,
‘collation’ => ‘utf8mb4_unicode_ci’,
‘prefix’ => env(‘DB_PREFIX’,‘user_’),
‘strict’ => false,
‘engine’ => null,
],
这篇关于larvel 出现ONLY_FULL_GROUP_BY SQL提示的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!