Magento 2 Upgrade Error SQLSTATE[42S02]: Base table or view not found

Magento 2 Upgrade Error SQLSTATE[42S02] Base table or view not found

In this article, you going to see how to fix the issue of Magento 2 Upgrade Error SQLSTATE[42S02]: Base table or view not found in a detail and step by step.

If you are looking for this topic then your at right place.

Let’s start with the topic regarding Magento 2 Upgrade Error SQLSTATE[42S02]: Base table or view not found.

This type of error mainly occur during the up-gradation of Magento version.

During the up-gradation of Magento 2 Version is complete and when you run setup upgrade command at that time you will get this issue.

Issue like SQLSTATE[42S02] Upgrade Error: Base table or view not found : Table ‘example_table‘ doesn’t exist.

It says that the example table does not present in your database.

If you face such type of error then at that what happen you can’t access your front end and back end.

The main reason of occurring of this issue is that when you install you old version of Magento 2 for example assume that your older Magento 2 version is 2.2.6.

In that Magento 2.2.6, if some of the extension version is 2.3.6 and in the current version of Magento 2.x.x, the version of extension is different for example 2.5.5.

Due to this different version of extension, this issue is get arise.

If you check the table name 'setup_module' in which schema_version and data_version in the current Magento 2 version database is different.

If you want to fix this issue, then there is two method to fix this issue.

First method is you can disable that extension or module, if there is not requirement of that module.

To directly disable that extension, you just have open the config file which is present under app/etc/ folder.

For disabling module just set extension “VendorName_ModuleName” = 1 to 0.

The second method is just manually changed schema_version and data_version of the 'setup_module' table by checking the current version of the extension VendorName_ModuleName.

Below is path from which you get current version extension.


Just you have to replace setup_version name from the XML file.

Below is the code snippet from which you can understand.

<module name="VendorName_ModuleName" setup_version="3.3.0">

Magento 2 Uncaught Referenceerror jQuery is not defined


Using above code you can fix the issue of SQLSTATE[42S02] Upgrade Error.

I hope you like this article and if you have any query, please comment below.