Closed dulao5 closed 2 years ago
dotenv
DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_PORT=4000 DB_DATABASE=test DB_USERNAME=root DB_PASSWORD=
config/databases.php
'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' => true, 'engine' => null, 'modes' => [ 'ONLY_FULL_GROUP_BY', 'STRICT_TRANS_TABLES', 'NO_ZERO_IN_DATE', 'NO_ZERO_DATE', 'ERROR_FOR_DIVISION_BY_ZERO', 'NO_ENGINE_SUBSTITUTION', ], ],
but var_dump :
["mysql"]=> array(13) { ["driver"]=> string(5) "mysql" ["host"]=> string(9) "127.0.0.1" ["port"]=> string(21) "tcp://10.0.9.193:4000" // replaced ??!!?? ["database"]=> string(4) "test" ["username"]=> string(4) "root" ["password"]=> string(0) "" ["unix_socket"]=> string(0) "" ["charset"]=> string(7) "utf8mb4" ["collation"]=> string(18) "utf8mb4_unicode_ci" ["prefix"]=> string(0) "" ["strict"]=> bool(true) ["engine"]=> NULL ["modes"]=> array(6) { [0]=> string(18) "ONLY_FULL_GROUP_BY" [1]=> string(19) "STRICT_TRANS_TABLES" [2]=> string(15) "NO_ZERO_IN_DATE" [3]=> string(12) "NO_ZERO_DATE" [4]=> string(26) "ERROR_FOR_DIVISION_BY_ZERO" [5]=> string(22) "NO_ENGINE_SUBSTITUTION" } }
bash-5.0 /projects/laravel-realworld-example-app $ echo $DB_PORT tcp://10.0.9.193:4000
🥲
dotenv
config/databases.php
but var_dump :