N
N
Nightmare0582021-01-27 03:23:05
PostgreSQL
Nightmare058, 2021-01-27 03:23:05

Why does the Database connection [postgres] not configured error appear?

The situation is as follows: deployed a new laravel project.
Installed postgresql 12.5, created database shop
Name | Owner | encoding | collate | type | Access privileges
----------+----------+----------+-------- -----+-------------+-----------------------
postgres | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |
shop | postgres | UTF8 | ru_RU.UTF-8 | ru_RU.UTF-8 |

configured .env:
DB_CONNECTION=postgres
DB_HOST=localhost
DB_PORT=5432
DB_DATABASE=shop
DB_USERNAME=postgres
DB_PASSWORD=1234

When migrating, it gives an error "InvalidArgumentException Database connection [postgres] not configured"

I checked the access to the database, it connects through PHPStorm without any problems.

Next I tried to install MySQL.
The situation is the same, only it does not connect even through PHPStorm, although I see the database through the console, I have assigned the rights.

In Google, I found only tips to clear the cache and remake .env, but it didn’t help.

What else can be checked?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Vasilyev, 2021-01-27
@hello_my_name_is_dany

DB_CONNECTION=pgsql

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question