Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Sbelvadi's avatar

Unable to run php artisan migrate on Ubuntu 14.04.4 x64.

Unable to run php artisan migrate on Ubuntu 14.04.4 x64. Am getting a [PDOException] SQLSTATE[08006] [7] FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres"

For testing purpose: I did the following: a. sudo su - postgres b. execute command psql c. ALTER USER postgres PASSWORD 'postgres' d. in the database.php file - made the following changes 'default' => env('DB_CONNECTION', 'pgsql'), 'pgsql' => [ 'driver' => 'pgsql', 'host' => env('DB_HOST', 'localhost'), 'port' => env('DB_PORT', ''), <-- I have a valid port on which postgres sql is listening 'database' => env('DB_DATABASE', '****'), <-- I have a valid database name here 'username' => env('DB_USERNAME', 'postgres'), 'password' => env('DB_PASSWORD', 'postgres'), 'charset' => 'utf8', 'prefix' => '', 'schema' => 'public', ],

Now when I run the below command: php artisan migrate

  • Application In Production!     *
    

Do you really wish to run this command? [y/N] (yes/no) [no]:

y [PDOException] SQLSTATE[08006] [7] FATAL: password authentication failed for user "postgres" FATAL: password authentication failed for user "postgres"

I recently created this droplet in DO, installed PHP, NGINX, POSTGRES SQL. I Know I probably should have used Forge.. But, would like to learn a little bit before i give up.. q: when I run the php artisan command - i thought it would get the database configuration from database.php file. Is this correct? q: Also when is the .env file read - only when the application is accessed through the web? q: Are there any php.ini or other configuration file changes I have to make? Any help or direction is greatly appreciated. Thanks

0 likes
3 replies
ejdelmonico's avatar

Did you happen to flush the DB privileges after you created the new user?

Sbelvadi's avatar

if you mean: GRANT ALL PRIVILEGES ON DATABASE ****** to postgres;

Yes

Sbelvadi's avatar

Error in Chair .. Not in Computer.. Sorry for the trouble.

Please or to participate in this conversation.