【问题标题】:base table or view not found after move the site to staging将站点移动到暂存后找不到基表或视图
【发布时间】:2016-01-12 05:21:59
【问题描述】:

Magento 1.9.2.2 从本地转移到临时环境,一切正常,只需一个扩展 - magentopros_productAttachments_attachment 不起作用,

a:5:{i:0;s:215:"SQLSTATE[42S02]: 未找到基表或视图:1146 表“magento.magentopros_productAttachments_attachment”不存在,查询为:SELECT COUNT(*) FROM magentopros_productAttachments_attachment AS main_table";i:1;s:5550:"#0 /var/www/public/lib/Varien/Db/Statement/Pdo/Mysql.php(110): Zend_Db_Statement_Pdo->_execute(Array )

但表实际上是存在的,并且在 core_resource 表中,请参见屏幕截图。

我尝试删除这些表和值并重新安装扩展程序,它可以工作,但是如果在移动到生产环境时表中有大量数据怎么办。

任何人都可以提出一个明确的解决方案,任何帮助将不胜感激。

【问题讨论】:

  • 表格似乎在视图中,但这并不一定意味着您的 PHP 脚本可以连接到数据库。

标签: mysql magento


【解决方案1】:

任何好的扩展都不应该发生这种情况。不过,如果您遇到此类问题,您可以转储与该特定扩展相关的表和数据,并在部署到 Live 时运行它。

步骤 1. 使用表转储前的数据(magentopros_productattachments_attachment 和 magentopros_productattachments_attachment_product)。

  1. 将整个数据库部署到实时站点。

  2. 不要更改 core_resouce 表数据以进行扩展。

  3. 删除表 magentopros_productattachments_attachment 和 magentopros_productattachments_attachment_product。

  4. 在 Live 站点中运行 SQL 转储。

【讨论】:

    【解决方案2】:
    1. 从数据库中删除扩展表
    2. 从core_resource 表中删除扩展设置文件,如(magentopros_productAttachments_setup)。
    3. 禁用缓存管理,然后运行您的项目。

    它会起作用的。

    【讨论】:

      猜你喜欢
      • 2021-09-24
      • 2015-12-23
      • 1970-01-01
      • 2015-11-19
      • 2023-04-01
      • 2018-05-31
      • 2020-07-20
      • 2017-07-22
      • 2018-10-17
      相关资源
      最近更新 更多