mysql - php artisan 迁移显示错误
问题描述
[在此处输入图片描述][1]
Illuminate\Database\QueryException:SQLSTATE[42S01]:基表或视图已经存在:1050 表“用户”已经存在(SQL:创建表users
(id
bigint unsigned not null auto_increment 主键,name
varchar(255) not null,email
varchar(255) not null, username
varchar(255) not null, email_verified_at
timestamp null, password
varchar(255) not null, remember_token
varchar(100) null, created_at
timestamp null, updated_at
timestamp null) 默认字符集 utf8mb4 collate 'utf8mb4_unicode_ci')
解决方案
使用以下命令:
php artisan migrate:rollback
或者
php artisan migrate:fresh
此错误向您显示,因为您之前尝试过运行命令“php artisan migrate”。这必须回滚以“撤消”这些更改,或者清除数据库表。
推荐阅读
- ethereum - Solidity 文档中的简单公开拍卖示例合同不支付受益人
- python - 继承类的 __init__ 调用内部函数的类
- google-photos - 尝试获取 oauth2 访问令牌时出现“invalid_scope”
- visual-studio-code - Cpplint 找不到可执行文件
- javascript - cb=gapi.loaded_0:76 未捕获的 uO {消息:“无效的 cookiePolicy”
- python - 如何在 Python 的字符串列表中使用“.endswith”?
- html - 停止在桌面上制作大于原始尺寸的图像
- asp.net-core-signalr - 什么是默认的 Javascript SignalR 客户端身份验证方案?
- python - 如何在不和谐[Python]中制作随机输出命令
- firebase - Google Cloud Firestore - 如何显示整个文档的一部分