Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
903 views
in Technique[技术] by (71.8m points)

magento2 - Unable to import mysql tables

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...