0

I'm using Magento 2.4.6 and the complete setup was working fine without any issue. The next morning, the Magento commands stopped working and threw the error below.

In Mysql.php line 109:

  SQLSTATE[42S02]: Base table or view not found: 1932 Table '[project].store_website' doesn't exist in engine, query was: SELECT `store_website`.* FROM `
  store_website`

enter image description here

Here is the error displayed in phpMyAdmin:

#1932 - Table '[project].store_website' doesn't exist in engine

The strange thing is that the store_website table exists in the database and has been double verified.

Note: I do have Magento setup in windows 11.

2
  • do you have any module added up recently if so then remove that module and run setup:upgrade Commented Jan 9 at 13:36
  • No new module has been added, and I have also tried the Magento commands after removing old modules. However, the issue still the same. Commented Jan 10 at 4:42

2 Answers 2

1

Seems the issue is with your setup so uninstall the setup with the command :

bin/magento setup:uninstall

and then re-run the install the magento setup bin/magento setup:install

reference: https://experienceleague.adobe.com/docs/commerce-operations/installation-guide/tutorials/uninstall.html YOu can manually remove the env.php and generated folder and can run install commands again

Additionally, if you can create the table in your DB with the below query and then can run the upgrade and deploy commands to have the instance up again

The structure of the table is:

 CREATE TABLE `store_website` (
  `website_id` smallint unsigned NOT NULL AUTO_INCREMENT COMMENT 'Website ID',
  `code` varchar(32) DEFAULT NULL COMMENT 'Code',
  `name` varchar(64) DEFAULT NULL COMMENT 'Website Name',
  `sort_order` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Sort Order',
  `default_group_id` smallint unsigned NOT NULL DEFAULT '0' COMMENT 'Default Group ID',
  `is_default` smallint unsigned DEFAULT '0' COMMENT 'Defines Is Website Default',
  PRIMARY KEY (`website_id`),
  UNIQUE KEY `STORE_WEBSITE_CODE` (`code`),
  KEY `STORE_WEBSITE_SORT_ORDER` (`sort_order`),
  KEY `STORE_WEBSITE_DEFAULT_GROUP_ID` (`default_group_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COMMENT='Websites';
2
  • 1
    Hi @Bibhu, It seems like the other tables are also corrupted because I'm getting the same error for other tables as well. The uninstall command is also not working due to this. So trying to uninstall it in other way. Commented Jan 10 at 7:34
  • 1
    +1 for your suggestion. Commented Jan 10 at 9:35
0

Solution:

To fix the corrupted database table issue, I had to uninstall the setup as suggested by @Bibhu. But I was unable to uninstall the setup due to further issues.

So I had to remove the database directory from the xampp/mysql/data directory & had to recreate the database in phpMyAdmin. I have explained more about the same into the below link:

Magento2: General error: 1010 Error dropping database (can't rmdir '.\[project]', errno: 41 "Directory not empty")

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.