Database connection [localhost] not configured.
bunlongheng opened this issue · 0 comments
bunlongheng commented
I stuck into this loop where I kept getting while running : php artisan migrate:refresh
Database connection [localhost] not configured.
In my database.php, I have this set
'connections' => [
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
],
In my .env, I have this
DB_CONNECTION=pgsql
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=ssh_server
DB_USERNAME=postgres
DB_PASSWORD=
Please Note :
'driver' => 'pgsql',
I already create a ssh_server in my local pqsl server, see it like so. I can even clicked on it to open it
Any hints for me ?