dongshan7060 2014-08-14 18:39
浏览 193
已采纳

Laravel:未找到基表或视图:1146表'database.pages不存在

I'm working on a CMS and I have a little problem with my migrations. I added a new migration file and I wanted to add that one. That didn't work so I ran this bit:

php artisan migrate:reset

After that I ran this bit:

php artisan migrate:install
php artisan migrate

And now I get this error:

{"error":{"type":"Illuminate\\Database\\QueryException","message":"SQLSTATE[42S02]: Base table or 
view not found:1146 Table 'cms.pages' doesn't exist (SQL: select * from `pages`)"

The error kinda tells me that it can't find the database, because that's true.

I also have a command that runs the migrate and I run that one like this:

php artisan app:install

But that shows the same error...

  • 写回答

2条回答 默认 最新

  • douhang8991 2014-08-14 18:54
    关注

    Remove any lines requesting data from your model from these files to be sure artisan is not trying to load data from your non-existent table:

    • bootstrap/start.php
    • app/start/global.php
    • app/start/local.php
    • app/routes.php

    Also be sure to un-register any service providers that utilize data from that table in their register or boot methods inside of app/config/app.php.


    The issue is that these files not only get executed for browser (web) requests, but for all requests, including command-line artisan invocations (e.g. php artisan migrate). So if you try to use something before it is available in any of these files, you are going to have a Bad Time.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 用stata实现聚类的代码
  • ¥15 请问paddlehub能支持移动端开发吗?在Android studio上该如何部署?
  • ¥170 如图所示配置eNSP
  • ¥20 docker里部署springboot项目,访问不到扬声器
  • ¥15 netty整合springboot之后自动重连失效
  • ¥15 悬赏!微信开发者工具报错,求帮改
  • ¥20 wireshark抓不到vlan
  • ¥20 关于#stm32#的问题:需要指导自动酸碱滴定仪的原理图程序代码及仿真
  • ¥20 设计一款异域新娘的视频相亲软件需要哪些技术支持
  • ¥15 stata安慰剂检验作图但是真实值不出现在图上