Jul 31, 2020
4
Level 4
password authentication failed for user "postgres"
This is my first time using postgres so I'm a little confused how to setup the connection here.
I installed postgres on Ubuntu from terminal with sudo apt install postgresql postgresql-contrib and I am able get into it using sudo -i -u postgres. I put this into my .env file
DB_CONNECTION=pgsql
DB_HOST=127.0.0.1
DB_PORT=5432
DB_DATABASE=postgres
DB_USERNAME=postgres
DB_PASSWORD=postgres
and I'm getting the authentication error. I tried putting my root password in there as well, but that didn't change anything. What did I do wrong here?
complete error for reference :
php artisan migrate
Illuminate\Database\QueryException
SQLSTATE[08006] [7] FATAL: password authentication failed for user "postgres"
FATAL: password authentication failed for user "postgres" (SQL: select * from information_schema.tables where table_schema = public and table_name = migrations and table_type = 'BASE TABLE')
at vendor/laravel/framework/src/Illuminate/Database/Connection.php:671
667| // If an exception occurs when attempting to run a query, we'll format the error
668| // message to include the bindings with SQL, which will make this exception a
669| // lot more helpful to the developer instead of just the database's errors.
670| catch (Exception $e) {
> 671| throw new QueryException(
672| $query, $this->prepareBindings($bindings), $e
673| );
674| }
675|
+34 vendor frames
35 artisan:37
Illuminate\Foundation\Console\Kernel::handle()
Level 54
Please or to participate in this conversation.