magento - inventory_stock_1 doest exist - 导入数据库时需注意用户权限

现象:在原网站,以mysql的root用户,通过mysqldump导出magento2的数据库文件。将导出的数据库文件导入到cPanel空间的数据库。访问cPanel空间的站点,提示出错:

2 exception(s):
Exception #0 (Zend_Db_Statement_Exception): SQLSTATE[42S02]: Base table or view not found: 1146 Table 'aqtest.inventory_stock_1' doesn't exist, query was: SELECT COUNT(DISTINCT e.entity_id) FROM `catalog_product_entity` AS

尝试:编辑导出的magento2数据库文件,将原

DEFINER=`root`@`localhost`

替换为现数据库用户,如

DEFINER=`aqtest`@`localhost`

,最后重新导入。

参考:https://magento.stackexchange.com/questions/259534/inventory-stock-1-doest-exist-on-magento-2-3

标签: mysql, magento

添加新评论