Laravel PHP Artisan Migration无法正常工作 [英] Laravel php artisan migrate not working

查看:101
本文介绍了Laravel PHP Artisan Migration无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试在Laravel中使用'php artisan migration'时,出现2个错误:

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

[Illuminate \ Database \ QueryException] SQLSTATE [HY000]:常规错误:26个文件已加密或不是数据库(SQL:从sqlite_master中选择*,类型='表',名称=迁移)

[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]:常规错误:26个文件已加密或不是数据库

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

在尝试迁移之前,我创建了一个storage/database.sqlite文件.我还编辑了config/database.php,使它成为default=sqlite.我正在使用Windows并已安装sqlite3.

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?

推荐答案

我有相同的结果,对于我来说,/database/database.sqlite文件不是空的.

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

我删除了内容重播 php artisan migrate,并且迁移表已成功创建.

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

这篇关于Laravel PHP Artisan Migration无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆