Van Adrian Cabrera
Van Adrian Cabrera

Reputation: 713

How to fix "Database (database.sqlite) does not exist." in Laravel?

I'm studying laravel then I switched mysql from sqlite. I deleted the database.sqlite file, configure the database.php to mysql and .env file.

I'm having a error "Database (database.sqlite) does not exist". How to fix this error?

Upvotes: 4

Views: 9992

Answers (3)

Codedreamer
Codedreamer

Reputation: 1702

If the above solution can not handle the current issue. click here

Issue with SQLite and Laravel on Heroku

Upvotes: 0

OLIVIERS
OLIVIERS

Reputation: 384

You don't need anything in the .env file except the DB_CONNECTION key/value pair. When you are using SQLite, remove all of the following keys:

DB_HOST

DB_PORT

DB_DATABASE

DB_USERNAME

DB_PASSWORD

Upvotes: 2

Atrakeur
Atrakeur

Reputation: 4234

The sqlite driver doesn't create the database file if it doesn't exist.

The simple solution is to create an empty file just before migrating the database into it (filling the file with schemas and data)

Simply put, this command will fix it:

 touch database/database.sqlite

Upvotes: 10

Related Questions