🔥 Just Launched! Werra Premium Template for HyväSee it in Action

Solved: inventory_stock_1 Doesn’t Exist in Magento 2

By Jignesh ParmarUpdated on May 22, 2025 1 min read

Magento 2 is widely used CMS to create online stores. Owing to its flexibility of customization, the platform is suitable for modern business requirements.

However, sometimes the developers are stuck with errors while developing custom functionalities or performing any operations on the Magento 2 store.

Today, I’ll talk about one such error that says,

inventory_stock_1 Doesn’t Exist

The inventory_stock_1 Doesn’t Exist error occurs while importing database in Magento 2.

For example, you are moving Magento 2 from localhost to server for which you need to import database.

The solution to inventory_stock_1 Doesn’t Exist in Magento 2 is the SQL query given below for you to refer:

Solution to the error “inventory_stock_1 Doesn’t Exist” in Magento 2:

Run the below SQL query:

CREATE
OR REPLACE
VIEW `inventory_stock_1` AS select
    distinct `legacy_stock_status`.`product_id` AS `product_id`,
    `legacy_stock_status`.`website_id` AS `website_id`,
    `legacy_stock_status`.`stock_id` AS `stock_id`,
    `legacy_stock_status`.`qty` AS `quantity`,
    `legacy_stock_status`.`stock_status` AS `is_salable`,
    `product`.`sku` AS `sku`
from
    ( `cataloginventory_stock_status` `legacy_stock_status`
join `catalog_product_entity` `product` on
        (( `legacy_stock_status`.`product_id` = `product`.`entity_id` )));

That’s it.

Also, do share the solution with Magento developers via social media.

Thank you.

Jignesh Parmar Full Image
Article byJignesh Parmar

An expert in his field, Jignesh is the team leader at Meetanshi and a certified Magento developer. His passion for Magento has inspired others in the team too. Apart from work, he is a cricket lover.