Magento - 基表 core_file_storage 不存在
当我查看 Magento 商店的错误日志时,它充满了这些错误:
[02-Jun-2011 13:49:12] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite_mysite.core_file_storage' doesn't exist' in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/mysite/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `e`.* FR...', Array)
#4 /home/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `e`.* FR...', Array)
#5 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/mysite/public_html/app/code/core/Mage/Core/Model/Mysql4/File/Storag in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php on line 234
有人知道如何解决这个问题吗?
When I look in the error log for my Magento store it is full of these errors:
[02-Jun-2011 13:49:12] PHP Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[42S02]: Base table or view not found: 1146 Table 'mysite_mysite.core_file_storage' doesn't exist' in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php:228
Stack trace:
#0 /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php(228): PDOStatement->execute(Array)
#1 /home/mysite/public_html/lib/Zend/Db/Statement.php(300): Zend_Db_Statement_Pdo->_execute(Array)
#2 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(479): Zend_Db_Statement->execute(Array)
#3 /home/mysite/public_html/lib/Zend/Db/Adapter/Pdo/Abstract.php(238): Zend_Db_Adapter_Abstract->query('SELECT `e`.* FR...', Array)
#4 /home/mysite/public_html/lib/Varien/Db/Adapter/Pdo/Mysql.php(337): Zend_Db_Adapter_Pdo_Abstract->query('SELECT `e`.* FR...', Array)
#5 /home/mysite/public_html/lib/Zend/Db/Adapter/Abstract.php(753): Varien_Db_Adapter_Pdo_Mysql->query(Object(Varien_Db_Select), Array)
#6 /home/mysite/public_html/app/code/core/Mage/Core/Model/Mysql4/File/Storag in /home/mysite/public_html/lib/Zend/Db/Statement/Pdo.php on line 234
Anyone know how to solve this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(8)
显然我还没有权限对丹尼尔的答案发表评论,因此我将其添加为单独的答案。用户 a1anm 也在 Magento 论坛上提出了这个问题。在那里,用户 Furnitureforyoultd 使用两个不同的查询回答了该问题。
首先,如果您还没有 core_directory_storage,请运行:
然后,运行:
Apparently I do not yet have the privileges to comment on Daniel's answer, therefore I'm adding this as a separate answer. User a1anm also asked the question on the Magento Forum. There, user furnitureforyoultd answered the question with two different queries.
First, if you do not yet have core_directory_storage, run:
Then, run:
这是 Magento 核心中的问题,已添加到跟踪器中并将得到修复。
但是,您应该意识到此错误的根源是您的文件的 URL 不存在。 Magento 核心中的唯一问题是它抛出“致命错误”而不是显示 404 页面。
要解决此问题,请检查为什么会收到不存在文件的 url。必须正确设置媒体文件夹和子文件夹的权限 - 例如 777(否则不会在其中创建图像)或 url 格式错误。
It's the issue in Magento core, that is added to tracker and will be fixed.
However, you should be aware that the source of this error is that you're having url to non-existent file. The only problem in Magento core is that it throws "Fatal error" instead of showing a 404 page.
To fix this trouble, check why you get an url to non-existent file. Either rights to your Media folder and subfolders must be set properly - e.g. 777 (otherwise images are not created there) or url is formed wrong.
您不应手动创建表,只需检查 media 文件夹的权限(必须可由 Web 服务器用户写入)。
You should not create tables manually, just check permissions for your media folder (must be writeable by a web server user).
这些表主要用于存储每个产品上传的图片。
此外,如果您的媒体默认存储设置为文件而不是数据库,magento 将尝试在文件系统中查找每个图像,但如果失败,它将尝试在数据库中查找。
请检查您的产品图片是否位于 media 文件夹中(通常为 media/catalog/product/{az|0-9}/{az|0-9}/yourimage.jpg),否则,即使创建这些表后,您也只能请求这些文件时收到 404 未找到错误。
These tables are mainly used for storing uploaded images for each product.
Furthermore, if your default storage for media is set to files and not to database, magento will try to look for each image in the file system, but if it fails, it will try to look it up in the database.
Please check whether your product images are in the media folder (typically media/catalog/product/{a-z|0-9}/{a-z|0-9}/yourimage.jpg) otherwise, even after creating those tables, you will only recive a 404 Not found error when requesting those files.
这个问题发生在我身上,我必须给媒体文件夹 777 权限。
This problem happened to me and I have to give 777 permission to the media folder.
另外,请注意,如果您尝试在产品标题中使用非法字符,例如引号,这将导致 magento 尝试创建包含该字符的缩略图。这将导致图像失败,magento 将尝试调用这些图像来自数据库..如果您没有使用数据库进行存储,您将看到 mysql 错误
also, please note that if you attempt to use illegal characters in the title of the product eg quotes this will cause magento to try and create a thumbnail with this character in it.. which will cause the images to fail and magento will try to call these images from the database.. if you are not using the database for storage you will see the mysql error
如果您将使用文件系统存储,请确保您的 /media 目录设置为 777 并运行
chmod -R o+w media
。如果错误仍然存在,解决问题的最简洁方法如下:core_directory_storage
删除最近创建的表中的所有行。您的表丢失错误现已消失。
If you will be using filesystem storage, Make sure your /media directory is set to 777 and also run
chmod -R o+w media
. If the error persists, the cleanest way to solve the problem is as follows:core_directory_storage
.Your table missing error is now gone.
缺失的表可以由系统自动创建,您所需要做的就是转到:
并选择将媒体文件存储在数据库中,然后在同步完成后将其关闭。这将创建缺失的表。
The missing tables can be create automatically by the system, all you need to do is go to:
and choosing to store media files in DB, and then turning it off after the synchronization is complete. This will create the missing tables.