Allow me to preface this by saying that yes, I have looked at the other similar questions regarding this and while they had a problem intrinsically linked to their code mine is completely fine on my local machine. With that said, I deployed a Laravel e-commerce store to my shared hosting account while following all the usual checklist to-dos i.e clear cache, routes, views, composer autoload -dev, etc and immediately got the error mentioned. Looking at the logs below the first error doesn't make sense to me as I've changed the .env DB credentials from the defaults for localhost to the ones I've made on the server. I have also confirmed they aren't hard-coded in the config/database.php file so with all that said can anyone help me understand this log file. The first line specifically makes no sense to me but maybe the problem lies elsewhere.
I also don't know if this is relevant but the logs appearing on my public folder have their file names as the location the app is on my local machine i.e C:\workspace\portfolio\shop\storage\logs
so maybe its a path issue? Don't know if this helps but the more info I provide and whatnot.
EDIT: SO isn't allowing me to post the full 51 line log here so if it can help I have posted it to my website.
[2021-05-05 17:16:44] production.ERROR: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from `shoes` where `tag` = Best Seller) {"exception":"[object] (Illuminate\\Database\\QueryException(code: 1045): SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: NO) (SQL: select * from `shoes` where `tag` = Best Seller) at /home/cruftedc/shushop/vendor/laravel/framework/src/Illuminate/Database/Connection.php:678)
[stacktrace]
As @apokryfos has mentioned in the comments under the question, the solution is simply to delete the files contained in bootstrap/cache
except .gitignore then run the command php artisan config:cache
on your server instead of locally. This is what made me have the log file folders with the local machine location as their names.
Deleting these files has indeed cleared the issue and the app is working albeit slower so running the command above really helps. Hope this helps someone else in the future. Happy programming everyone ✌️