PDOExceptionvendor/laravel/framework/src/Illuminate/Database/Connectors/Connector.php:47
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: YES)
I have updated .env file with the correct credentials (its not even localhost anymore, its an IP address) however I keep getting this error message. I have already run php artisan config:clear
as well too. How can I force a production app to use the new credentials in its .env file?
My config/database.php is standard:
'connections' => [
'mysql' => [
'driver' => 'mysql',
'host' => env('DB_HOST', 'localhost'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'port' => env('DB_PORT', '3306'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false,
],
],
Run the following Artisan commands then try again:
php artisan cache:clear
php artisan config:clear
php artisan config:cache
php artisan route:clear
php artisan route:cache
Good lord, almost lost my mind trying fix this. There was no problem with the DB connection on the web requests, but I was still getting connection errors in my bug reporting. Seems the issue was the queue we were running was holding the old config values.
ps aux | grep php
Find the queue:work
process and kill it, it will start up again automatically but read in your new config values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With