I'm working with Laravel, and everything is fine so far. But sometimes, when I request a webpage, an error occurs :
🧨 SQLSTATE[HY000] [1045] Access denied for user 'forge'@'localhost' (using password: NO)
I don't understand why and when this error occurs, it seems very random (~5%), and reloading the page fix it. My .env file looks like this :
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=mydatabase
DB_USERNAME=my_username
DB_PASSWORD=password_strong
Where does this user 'forge' come from ? I never had one. I tried php artisan config:clear and php artisan cache:clear but I still get the error times to times.
Note : I'm saying that this error seems to be random because I use Ajax to load some subPage in my main page. And sometimes one of theses elements fail to load with this error, but not everytimes and not always the same.
i think problem in the AppServiceProvider. i had a query i used in the boot function. I think this was trying to executed a query before env file loaded.