YaYan_csdn 2022-02-16 23:51 采纳率: 0%
浏览 72

Larvael8 迁移文件 php artisan migrate 报错

C:\Study\php\newblog>php artisan migrate
Migrating: 2019_12_14_000001_create_personal_access_tokens_table

Illuminate\Database\QueryException

SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘personal_access_tokens’ already exists (SQL: create table personal_access_tokens (id bigint unsigned not null auto_increment primary key, tokenable_type varchar(191) not null, tokenable_id bigint unsigned not null, name varchar(191) not null, token varchar(64) not null, abilities text null, last_used_at timestamp null, created_at timestamp null, updated_at timestamp null) default character set utf8mb4 collate ‘utf8mb4_unicode_ci’)

at C:\Study\php\newblog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:712
708▕ // If an exception occurs when attempting to run a query, we’ll format the error
709▕ // message to include the bindings with SQL, which will make this exception a
710▕ // lot more helpful to the developer instead of just the database’s errors.
711▕ catch (Exception $e) {
➜ 712▕ throw new QueryException(
713▕ $query, $this->prepareBindings($bindings), $e
714▕ );
715▕ }
716▕ }

1 C:\Study\php\newblog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:501
PDOException::(“SQLSTATE[42S01]: Base table or view already exists: 1050 Table ‘personal_access_tokens’ already exists”)

2 C:\Study\php\newblog\vendor\laravel\framework\src\Illuminate\Database\Connection.php:501
PDOStatement::execute()

**解决办法就是把显示已存在的表给删除了就完事了
再运行 php artisan migrate
_

  • 写回答

2条回答 默认 最新

  • CSDN专家-黄老师 2022-02-17 09:38
    关注

    1050 Table ‘personal_access_tokens’ already exists”)是提示数据表已经存在了,说明数据库的表应该已存在才执行迁移的

    评论

报告相同问题?

问题事件

  • 修改了问题 2月16日
  • 创建了问题 2月16日

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器