浏览文章

文章信息

Magento2 NoSuchEntityException: The website with id 0 that was requested wasn't found 15209

报错NoSuchEntityException: The website with id 0 that was requested wasn't found

原因:

数据库搬迁时站点store_website的id从1自增,而非0


解决:

SET FOREIGN_KEY_CHECKS=0;
UPDATE `store` SET store_id = 0 WHERE code='admin';
UPDATE `store_group` SET group_id = 0 WHERE name='Default';
UPDATE `store_website` SET website_id = 0 WHERE code='admin';
UPDATE `customer_group` SET customer_group_id = 0 WHERE customer_group_code='NOT LOGGED IN';
SET FOREIGN_KEY_CHECKS=1;


原创