I recently got onto a new project and it seems their database is a mess. Of course they don't have a backup version of it either, so I have been trying to export the database and importing it again so I have a test server to develop on. I have no prior knowledge with SQL, I've just been designing the front end of sites for a while, this is all new to me.
The database is over a gig large, so I used BigDump to load my sql database in batches, it gets to 100%, and then bam. I get a foreign key error. I am at a loss right now trying everything I could think of, so I come to you guys! Any ideas or help will be greatly appreciated!!
Here is the error it gives me;
Error at the line 3266725:
ADD CONSTRAINT `FK_CATRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID`
FOREIGN KEY (`customer_group_id`)
REFERENCES `customer_group` (`customer_group_id`)
ON DELETE CASCADE ON UPDATE CASCADE;
Query: --
--
ALTER TABLE `catalogrule_customer_group`
ADD CONSTRAINT `FK_CATALOGRULE_CUSTOMER_GROUP_RULE_ID_CATALOGRULE_RULE_ID`
FOREIGN KEY (`rule_id`)
REFERENCES `catalogrule` (`rule_id`)
ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `FK_CATRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID`
FOREIGN KEY (`customer_group_id`)
REFERENCES `customer_group` (`customer_group_id`)
ON DELETE CASCADE ON UPDATE CASCADE
MySQL: Cannot add or update a child row: a foreign key constraint fails (johnsoja_magento2
.#sql-3a72_5d7aff
,
CONSTRAINT `FK_CATRULE_CSTR_GROUP_CSTR_GROUP_ID_CSTR_GROUP_CSTR_GROUP_ID`
FOREIGN KEY (`customer_group_id`)
REFERENCES `customer_group` (`customer_group)
This truly is all like another language to me, and it seems like if I fix one thing here, it'll just show me the next problem along the line. What to do?! Thanks!