Search code examples
laravel-5wampserver

Unknown database issue after re-installing wamp server


After having trouble with wamp server, i've uninstalled it and made a mistake by moving the www folder and download wamp all over again.

So after installing wamp and fixing the problem i had, my project (using laravel) doesn't work anymore:

SQLSTATE[HY000] [1049] Unknown database 'db_name'

I tried php artisan cache:clear but nothing changed

How can I fix this?


Solution

  • The problem is that Laravel can't find a database. Maybe you forgot to restore your database(s)? The thing is with uninstalling WAMP, you have deleted MySQL with all databases (M in WAMP stands for MySQL).

    Or maybe you forgot to setup DB host, user and password in .env file.