【问题标题】:SQLSTATE[42S02]: Base table or view not found: 1146 Table 'blog.roles' doesn't existSQLSTATE [42S02]:未找到基表或视图:1146 表 'blog.roles' 不存在
【发布时间】:2021-10-17 05:57:32
【问题描述】:

我克隆了一个项目。当我运行composer install 时出现此错误

SQLSTATE[42S02]: Base table or view not found: 1146 Table 'axie.roles' doesn't exist (SQL: select * from `roles` where `id` = 3 and `guard_name` = web limit 1)

即使我运行这个命令

php artisan cache:clear
php artisan view:clear
php artisan config:clear
php artisan optimize:clear
composer dump-autoload
composer install
composer update
php artisan migrate

还是同样的错误..

【问题讨论】:

  • 确保你的数据库中有roles 表,先迁移然后更新

标签: laravel laravel-8


【解决方案1】:

检查您是否在database/migrations 文件夹中添加了roles 表。

同时检查您是否连接到正确的数据库(您可以使用DB::connection()->getConfig() 命令查看)。如果没有正确编辑.env文件。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-12-22
    • 2018-04-19
    • 2015-10-05
    • 2018-06-30
    • 2021-05-13
    • 2020-04-28
    • 2015-09-22
    相关资源
    最近更新 更多