Laravel 5.5 Error Base table or view already exists: 1050 Table 'users' already exists

前端 未结 15 1293
温柔的废话
温柔的废话 2020-11-30 10:22

Specifications:

  • Laravel Version: 5.5.3
  • PHP Version: 7.1
  • Database Driver & Version: MariaDB 10.1.26

相关标签:
15条回答
  • 2020-11-30 11:08

    Here are the steps I took to solve the same issue:

    1. In the console I wrote php artisan tinker

    2. Then, again in the console, Schema::drop('users')

    3. At the end php artisan migrate and it all worked.

    0 讨论(0)
  • 2020-11-30 11:08

    Create your migrations by command php artisan make:migration create_category_table Then in your database/migrations set your necessary fields and databases,then run this command pho artisan migrate --pretend It will show sql statements,copy sql statement of category and paste it in database in sql and just click on run,your migrations would be there,no need to delete users table

    0 讨论(0)
  • 2020-11-30 11:10

    The simple way to solve this problem is run the following command

    php artisan migrate:fresh

    0 讨论(0)
  • 2020-11-30 11:11

    Following command solved my problem:

     1. php artisan tinker
     2. Schema::drop('your_table_name')
     3. php artisan migrate
    
    0 讨论(0)
  • 2020-11-30 11:14

    Migration errors usually occur when using php artisan migrate and your migration has an error.

    Within Laravel, there are some ways to reverse something that has been performed, especially migrations to more robust databases like MySql, for example.

    One way to be reversing the step taken

    php artisan migrate
    

    is to run the

    php artisan migrate: rollback
    

    It automatically reverses the last migrate performed You also have the possibility to delegate how many steps will be reversed with the step parameter.

    The number says how many steps will be reversed

    php artisan migrate: rollback --step=1
    
    0 讨论(0)
  • 2020-11-30 11:15

    Here are the steps I took to solve the same issue:

    1. php artisan make:migration create_tableName_table --create=tableName.

    2. php artisan migrate.

    3. appear error,you can drop all file in migration and all table in database.

    4. create new table as 1.

    5. finish. okay.

    0 讨论(0)
提交回复
热议问题