2017-12-18 115 views
1

我嘗試在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

回答

1

嘗試

php artisan migrate:fresh 

或者

手動清空數據庫,包括遷移表,然後再次嘗試遷移。

+0

其實我不能做新鮮或刷新。 Bcz它是一個實時數據庫。 – Hashan

0

試試這個

php artisan migrate:refresh 

可我希望這項工作。

相關問題