MySQL的错误:表或​​视图已经存在

MySQL的错误:表或​​视图已经存在

问题描述:

我尝试在MySQL中创建一个表,但我得到以下错误:MySQL的错误:表或​​视图已经存在

SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'migrations' already exists (SQL: create table migrations (id int unsigned not null auto_increment primary key, migration varchar(255) not null, batch int not null) default character set utf8 collate utf8_unicode_ci)

我该如何解决这个问题?

+1

如果MySQL说已经有一个表,那么你是运行'php artisan migrate'还是'php artisan migrate:install'? – nogad

+0

? – lagbox

+0

php artisan migrate – Hashan

尝试

php artisan migrate:fresh 

或者

手动清空数据库,包括迁移表,然后再次尝试迁移。

+0

其实我不能做新鲜或刷新。 Bcz它是一个实时数据库。 – Hashan

试试这个

php artisan migrate:refresh 

可我希望这项工作。