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?
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
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With