0
votes

I have deployed my project on my webserver. The .env contains the right settings for the web database but for some reason Laravel still try to connect to localhost.

The problem is that if I use any of the php artisan xxx:clear, it gives the same error:

SQLSTATE[HY000] [1698] Access denied for user 'root'@'localhost' ...

So I can I force Laravel 8 to clear the cache (as I guess this is the problem) and read the correct credentials in the .env file?

1
you need to clear php artisan config:clear for clear env data - sta
you can set db credential into config > databse.php and into the bootstrap folder, probably you will find a cache folder .. delete cache folder .... I think it will be okay.. - نور
@نور the cache folder is created again as well for older version and in newer version the path of cache folder is changed & is placed in vendor - bhucho
try this command:- php artisan optimize - Mohamed Ahmed
@bhucho for removing current cache , I suggest to delete... I faced similar problem before.. actually it's worked for me...what is the issue ? - نور

1 Answers

0
votes

hey you can use these commands

php artisan config:cache
php artisan config:clear
php artisan cache:clear

thanks :)