Hashan
Hashan

Reputation: 180

MySQL-Error: Table or view already exists

I try to create a table in MySQL but I get the following error:

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)

How can I fix this?

Upvotes: 1

Views: 1342

Answers (2)

Niket Joshi
Niket Joshi

Reputation: 738

Try this

php artisan migrate:refresh

may i hope this work.

Upvotes: 0

Sapnesh Naik
Sapnesh Naik

Reputation: 11656

Try

php artisan migrate:fresh 

Or

Manually empty the database and including the migrations table and then try migrating again.

Upvotes: 1

Related Questions