Honestly I don't know what is broken from v11 to v12. But in your case I would try something like:
write => null,
// or
write => [],
// or
write => [
host => [],
],
Setting host name to empty string seems odd to me.
I have an application, where I connect to multiple db-s. I have In 8 connections 3 where read & write credentials are separately defined, and the rest where only the read were defined and write was left empty.
'mysql' => [
'driver' => 'mysql',
'port' => env('DB_PORT', 3306),
'database' => env('DB_MYSQL_DATABASE'),
'read' => [
'host' => [
env('DB_MYSQL_HOST'),
],
'username' => env('DB_MYSQL_READ_USERNAME'),
'password' => env('DB_MYSQL_READ_PASSWORD'),
],
'write' => [
'host' => [
env('DB_MYSQL_HOST'),
],
'username' => env('DB_MYSQL_WRITE_USERNAME'),
'password' => env('DB_MYSQL_WRITE_PASSWORD'),
],
],
'mysql_second' => [
'driver' => 'mysql',
'port' => env('DB_PORT', 3306),
'database' => env('DB_MYSQL_SECOND_DATABASE'),
'read' => [
'host' => [
env('DB_MYSQL_SECOND_HOST'),
],
'username' => env('DB_MYSQL_SECOND_READ_USERNAME'),
'password' => env('DB_MYSQL_SECOND_READ_PASSWORD'),
],
'write' => [
'host' => [
''
],
],
]
This worked under laravel 11. After I've upgraded to version 12 I'm getting
SQLSTATE[HY000] [2002] No such file or directory for those connections where the write is left empty like above.
My question is what happened in the upgrade? Does anyone had some similar issues?
And yeah, why don't I write it into single dimension without read, write in this second scenario, even if it works like that?
Because I wanted to keep the structure.
Probably I will if there's no other solution.
NOTE: maybe it's not in the upgrade, but on system I use it. On live test server (debian 12) everything seems okay yet. But in my local env, macos under Herd, it got broken.
Thanks in advance,
Val
Please or to participate in this conversation.