[英]Illuminate\Database\QueryException : SQLSTATE[HY000]: General error: 1813 Tablespace for table
I Tried to migrate purchases table for my project我尝试为我的项目迁移采购表
When i tried to migrate and it's showing Table Space error.当我尝试迁移时,它显示表空间错误。
General error: 1813 Tablespace for table '
jshop
.一般错误:1813 表“
jshop
”的表空间。purchases
' exists.purchases
' 存在。 Please DISCARD the tablespace before IMPORT.请在 IMPORT 之前丢弃表空间。
Migrate Code Below :迁移代码如下:
Schema::create('purchases', function (Blueprint $table) {
$table->increments('id');
$table->integer("product_price");
$table->integer("product_qty");
$table->unsignedInteger('invoice_id');
$table->unsignedInteger('product_id');
$table->unsignedInteger('weight_id');
$table->timestamps();
$table->foreign("invoice_id")->references('id')->on('invoices');
$table->foreign("product_id")->references('id')->on('products');
$table->foreign("weight_id")->references('id')->on('weights');
});
Error Message Image Below : Migration Error image Link How to solve this ?错误消息图片如下:迁移错误图片链接如何解决这个问题?
try this:尝试这个:
php artisan migrate:refresh
if it is not solve this error try this:如果它不能解决这个错误试试这个:
Go to mysql/data/database_name /tablename.ibd file
and delete it manually.转到
mysql/data/database_name /tablename.ibd file
并手动删除它。 after this try your command php artisan migrate
在此之后尝试你的命令
php artisan migrate
删除数据库并创建一个新的。
Locate where your database is and delete the table.找到您的数据库所在的位置并删除该表。 Then run PHP artisan migrate This worked for me
然后运行PHP artisan migrate这对我有用
Your database is corrupted, do the followinf steps to fix it.您的数据库已损坏,请执行以下步骤来修复它。
SETP 1. Drop the database and create a new one. SETP 1. 删除数据库并创建一个新的。
SETP 1. run the following command SETP 1.运行以下命令
php artisan migrate:refresh
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.