check that your local .env file contains the correct database credentials and matches what you have in your config/database.php
or run command php artisan config:clear php artisan cache:clear
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I'm building an App with React and Laravel. My Dashboard (react) has many queries to Laravel (each widget, something like that). Sometime, Laravel just not read the env right in couple of fetches.
SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO) (Connection: mysql, SQL: select * from `personal_access_tokens` where `personal_access_tokens`.`id` = 49 limit 1)
I tried something like clearing cache of env. But it's still happening couple of times. It's so annoying. What's happening?
note: Production is good.
Please or to participate in this conversation.