Php – Laravel php artisan migrate not working

laravellaravel-artisanmigratePHPsqlite

When I try to use 'php artisan migrate' in Laravel I get 2 errors:

[Illuminate\Database\QueryException] SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database (SQL: select * from sqlite_master where type = 'table' and name = migrations)

[PDOException] SQLSTATE[HY000]: General error: 26 file is encrypted or is not a database

I created a storage/database.sqlite file before attempting the migration. I also edited the config/database.php, making the default=sqlite. I am using windows and have sqlite3 installed.

Has anyone encountered this/know how to get past it?

Best Answer

I had the same results, in my case the /database/database.sqlite file was not empty.

I deleted the contents reran php artisan migrate and the migration table was created successfully.