我正在尝试在 laravel 5.8 上使用 migrate 但我收到此错误消息C:\wamp\www\work_p\laravel\lvl1>php artisan migrateMigrating: 2014_10_12_000000_create_users_table Illuminate\Database\QueryException : SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists (SQL: create table `users` (`id`bigint unsigned not null auto_increment primary key, `name` varchar(191) not null, `email` varchar(191) not null, `email_verified_at` timestamp null, `password` varchar(191) not null, `remember_token` varchar(100) null, `created_at` timestamp null, `updated_at` timestamp null) default character set utf8mb4 collate 'utf8mb4_unicode_ci') at C:\wamp\www\work_p\laravel\lvl1\vendor\laravel\framework\src\Illuminate\Database\Connection.php:664 660| // If an exception occurs when attempting to run a query, we'll format the error 661| // message to include the bindings with SQL, which will make this exception a 662| // lot more helpful to the developer instead of just the database's errors. 663| catch (Exception $e) { > 664| throw new QueryException( 665| $query, $this->prepareBindings($bindings), $e 666| ); 667| } 668| Exception trace: 1 PDOException::("SQLSTATE[42S01]: Base table or view already exists: 1050 Table 'users' already exists") C:\wamp\www\work_p\laravel\lvl1\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458 2 PDOStatement::execute() C:\wamp\www\work_p\laravel\lvl1\vendor\laravel\framework\src\Illuminate\Database\Connection.php:458 Please use the argument -v to see more details.我在这里找到的所有解决方案都说我必须删除表格;但是我不能在我的表上有数据我在我的用户表和所有其他表上都有数据。如果没有删除表,是否有任何解决此错误的方法?我确实尝试使用此解决方案public function boot(){ Schema::defaultStringLength(191);}问题仍然存在
1 回答
幕布斯7119047
TA贡献1794条经验 获得超8个赞
如果您不想专门运行该迁移,请在您的数据库上运行此查询
INSERT INTO `migrations` (`id`, `migration`, `batch`) VALUES (NULL, '2014_10_12_000000_create_users_table', '1');
- 1 回答
- 0 关注
- 147 浏览
添加回答
举报
0/150
提交
取消