I’m currently working on a Laravel project. I did the deploy on a shared server, but I get the error message
“SQLSTATE [HY000] [1045] Access denied for user ‘root’ @ ‘localhost’ (using password: NO)”
The project in Local works me correctly, but on the server it’s limited to error only. I configured the environment variables in my .env
I think that the server probably does not read the .env file and that is why the problem arises.
3
Answers
Actually the problem was with my Hosting.
My best option was to start using DigitalOcean.
But at that moment what I did was:
Route::get('/cache', function() { $clear = Artisan::call('cache:clear'); return "Cache cleared"; });
I take this opportunity to thank those people who helped me at that time.
And if you are going through this: Avoid at all costs modifying the database.php file. This isn't a good practice... And change your hosting for a DigitalOcean VPS.
Clear your cache on live server by adding and running this route:
You have to add your proper database credentials to .env file .. you can find the database credentials in cPanel