Tom Thomson
Tom Thomson

Reputation: 442

Laravel 5.5: SQLSTATE[42S02]: Base table or view not found

Because my database had an error and didn't start anymore I reinstalled mysql completely. But now my laravel project is broken. Errors: When I visit the site:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asp.projects' doesn't exist (SQL: select * from `projects`)

When I run console commands:

In Connection.php line 664:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asp.projects' doesn't exist (SQL: select * from `projects`)


In Connection.php line 326:

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'asp.projects' doesn't exist

I already tried:

php artisan migrate
php artisan migrate:reset
php artisan dump-autoload
composer dump-autoload

Sadly I am not quite sure what I should do. All of these commands will return the error. I am sorry when the answer has been already posted here but I couldn't find it. I hope you can help me, Tom

Upvotes: 0

Views: 3732

Answers (1)

Tom Thomson
Tom Thomson

Reputation: 442

My fault was that I had the variable $project = App\Project::all() defined in routes\web.php When I had the migration this worked well but as soon as I had to migrate again it caused the error.

Upvotes: 5

Related Questions