首页 > 代码库 > laravel常见错误解析

laravel常见错误解析

 Syntax error or access violation: 1055 

sql_mode设置导致的问题, 修改 config/database.php配置 strict => false

‘mysql‘ => [
    ‘driver‘ => ‘mysql‘,
    ‘host‘ => env(‘DB_HOST‘, ‘localhost‘),
    ‘port‘ => env(‘DB_PORT‘, ‘3306‘),
    ‘database‘ => env(‘DB_DATABASE‘, ‘forge‘),
    ‘username‘ => env(‘DB_USERNAME‘, ‘forge‘),
    ‘password‘ => env(‘DB_PASSWORD‘, ‘‘),
    ‘charset‘ => ‘utf8‘,
    ‘collation‘ => ‘utf8_unicode_ci‘,
    ‘prefix‘ => ‘‘,
    ‘strict‘ => false,
    ‘engine‘ => null,
],

laravel常见错误解析