Specifications:
Laravel Version: 5.4 PHP Version: 7.0.9 Composer version 1.9.0 XAMP
Description:
In Connection.php line 647:
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, name
varchar(255) not null, email
varchar(255) not null,
password
varchar(255) not null, remember_token
varchar(100) null, created_at
timestamp null, updated_at
tim
estamp null) default character set utf8mb4 collate utf8mb4_unicode_ci)
In Connection.php line 449:
SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists
Problem: I have created models and tables of user and Product. It successfully created both migrations and tables but failed to migrate on phpmyadmin sql.
Steps I tried: I have dropped all database and recreated it but still it gives error. I have also used tinker but error is same.
code:
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}
Schema::create('users',...
? – nakov