I have deleted Magento products accidentally, so i tried to restore them.
I have an old backup, so my idea is to delete all catalog tables that begins with 'catalog_', and to import them from a backup, but when trying to import tables, i got this error
#1005 - Can't create table xxxx_dbnew
.catalog_product_entity
(errno: 150 "Foreign key constraint is incorrectly formed")
The table structure
CREATE TABLE `catalog_product_entity` (
`entity_id` int(10) UNSIGNED NOT NULL COMMENT 'Entity ID',
`attribute_set_id` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Attribute Set ID',
`type_id` varchar(32) NOT NULL DEFAULT 'simple' COMMENT 'Type ID',
`sku` varchar(64) DEFAULT NULL COMMENT 'SKU',
`has_options` smallint(6) NOT NULL DEFAULT 0 COMMENT 'Has Options',
`required_options` smallint(5) UNSIGNED NOT NULL DEFAULT 0 COMMENT 'Required Options',
`created_at` timestamp NOT NULL DEFAULT current_timestamp() COMMENT 'Creation Time',
`updated_at` timestamp NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT 'Update Time'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Catalog Product Table';
Any solution?
question from:
https://stackoverflow.com/questions/65858234/unable-to-import-mysql-tables 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…