Loin's avatar
Level 1

Migrate base table or view already exist

Hi Friends please help, I created a new migration shop_table and my table name is shops but when i migrate php artisan migrate it shows below

Note: i have already other table by name of myusers

[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'myusers' al ready exists (SQL: create table myusers (id int unsigned not null auto_ increment primary key, username varchar(255) not null, password varchar (255) not null, bio text null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)

[PDOException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'myusers' al ready exists

0 likes
2 replies
tykus's avatar

Your migrations are out of sync with your schema, if your are still in development in L5.5) you can run php artisan migrate:fresh to drop everything including data and rebuilt schema

Loin's avatar
Level 1

I'm using Laravel 5.4 and I don't want to lost my data the table that created before.

Please or to participate in this conversation.