Support the ongoing development of Laravel.io →
posted 8 years ago
Database

hi i have problem with migration when i use php artisan migrate show below error :

windows command line; C:\Users\Google\projects\minisocialnetwork>php artisan migrate

[Illuminate\Database\QueryException] SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table users ( id int unsigned not null auto_increment primary key, username varchar(32) not null, dob date not null, name varchar(255) not null, email varchar(255) not null, password varchar(255) not null, remember_token varchar(10 0) null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate utf8mb4_un icode_ci)

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

// I can not see the other tables except the user table in the database

laravel 5.4

<?php use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; class CreatePostsTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('posts', function (Blueprint $table) { $table->increments('id'); $table->integer('user_id'); $table->text('content'); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('posts'); } }
Last updated 2 years ago.
0

You need to generate autoload files.

In terminal navigate to your project and run: composer dump-autoload and than try to migrate

0

Sign in to participate in this thread!

Eventy

Your banner here too?

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.