【问题标题】:Did a migration to database (hrm-master) and got this errors迁移到数据库(hrm-master)并得到这个错误
【发布时间】:2019-03-21 13:39:56
【问题描述】:

SQLSTATE[42S02]:未找到基表或视图:1146 表 'hrm-master.sessions' 不存在(SQL: select * from sessions 其中id = FCtzXvm1CTIvGJCfWuTVyO1bpyDIDVnt9FlmoCAY 限制 1)

在 Connection.php 第 647 行 Connection->runQueryCallback('select * 从sessions 哪里id = ?限制 1', 数组('FCtzXvm1CTIvGJCfWuTVyO1bpyDIDVnt9FlmoCAY'),对象(闭包)) Connection.php 第 607 行

【问题讨论】:

  • 如果您以 PHPMyAdmin 之类的方式查看数据库,会话表是否存在?

标签: laravel-5 laravel-migrations


【解决方案1】:

您已将会话配置为使用config/session.php 上的数据库。

您可以在此处阅读文档:https://laravel.com/docs/5.7/session#database-sessions

确保你有这个表/迁移:

Schema::create('sessions', function ($table) {
    $table->string('id')->unique();
    $table->unsignedInteger('user_id')->nullable();
    $table->string('ip_address', 45)->nullable();
    $table->text('user_agent')->nullable();
    $table->text('payload');
    $table->integer('last_activity');
});

如果没有,请运行以下命令:

php artisan session:table

php artisan migrate

【讨论】:

  • 感谢这解决了问题。感谢您的大力协助。
猜你喜欢
  • 1970-01-01
  • 2019-04-25
  • 1970-01-01
  • 2016-03-05
  • 1970-01-01
  • 1970-01-01
  • 2015-06-08
  • 2015-04-06
相关资源
最近更新 更多