My project was working fine. After copy and pasting files in another Mac localhost, I always get the same error:
[Illuminate\Database\QueryException]
SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database '***' (SQL: select * fromroles
)[PDOException]
SQLSTATE[HY000] [1044] Access denied for user ''@'localhost' to database '***'
I already checked the .env
file, but it seems Laravel can't execute code at this point. This 'roles' is a table with many to many relations trough pivot table.
Note 1: Fresh Laravel aplications works fine.
Note 2: Because I can't clear the cache, Laravel always considers the user to b be blank.
Can someone help me, please?
Thank you!
I replaced files off a fresh application with my files(models, controllers, middlewares, migrations ...) and everything worked fine.
The solution: