is this a setting in config/database where you can disable/enable strict mode.
Disable sql_mode on Forge for a particular application
I have installed an old app on my forge server and according to that topic Disable MySQL Strict Mode on Forge I was able to disable sql_mode globally so that the old app can run its sql queries.
But there are many other apps installed on the server and I do not want to change the mysql settings for all of them. I know it is possible to change the modes for a particular laravel app but for the old application I am missing this feature.
Is there a way to add those mysql configs (sql_mode='') to only a particular installed app on forge?
@matthiascw Sure, you just set it true/false in /config/database.php for the connection on a per-app basis. You don't need to mess with the actual server settings at all!
'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' => '',
'prefix_indexes' => true,
'strict' => true, // right here - it's enabled by default
'engine' => null,
],
https://github.com/laravel/laravel/blob/master/config/database.php#L55
Please or to participate in this conversation.