How can we solve “SQLSTATE[HY000] [1045] Access denied” issue with Laravel
How can we solve “SQLSTATE[HY000] [1045] Access denied” issue with Laravel
How can we fix: SQLSTATE[HY000] [1045] Access denied for user ‘root’@’localhost’ (using password: NO) (SQL: select * from `sessions` where `id` = zuG54ghzLhCLCHeHHgKeqrxFrX1dzlwX8QpqMiz2 limit 1) issue in Laravel.
Thank you Sugesh! for the reference however It couldn’t solve my issue.
However, Now I understood and solved the issue is with the environment; Laravel is not clearing the environment when we updated it so the easiest way around is.
Clearing the config cache with
php artisan config:clear
And Clear all other caches with
php artisan optimize:clear
And edit the .env file before uploading it to the original site.
Here are my references:
Laravel Artisan Cache Commands Explained – DEV Communityphp – SQLSTATE[HY000] [1045] Access denied for user ‘username’@’localhost’ (using password: YES) – Stack Overflow