Laravel: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'db.sessions' doesn't exist
Laravel queried a table that hasn’t been created — usually sessions, cache, jobs or a new model’s table.
Seen on:
PHP
Meaning
Using SESSION_DRIVER=database, CACHE_STORE=database or QUEUE_CONNECTION=database requires their tables. Laravel 11 defaults to database drivers, so a fresh install without php artisan migrate fails immediately.
Common causes
- Migrations not run on this environment
- Database driver configured without its table
- Wrong DB_DATABASE in .env
⚡ Quick fix
php artisan migrate --force- Or switch drivers to file/array in .env
- Verify DB_DATABASE points to the right database
Detailed fix by platform
PHP
- Laravel 10:
php artisan session:table && php artisan migrate
How to diagnose
- Table — Which table is missing?
- Driver — Which driver needs it?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026