*

Ahmed Al-shami

  • **
  • 18 posts
Geolocation Data Import Error
« on: December 05, 2025, 03:26:12 PM »
When I try to import Geolocation .sql data, why do I get the following error message "1451 - Cannot delete or update a parent row: a foreign key constraint fails (`osclass-3138330c13`.`oc_t_city`, CONSTRAINT `oc_t_city_ibfk_2` FOREIGN KEY (`fk_c_country_code`) REFERENCES `oc_t_country` (`pk_c_code`))"

What should I do?

*

MB Themes

Re: Geolocation Data Import Error
« Reply #1 on: December 08, 2025, 03:08:18 PM »
Identify why that error happens.
you can take that file and run directly on database if that is more convenient.
From error it looks like you are trying to add city with country code that does not exists in t_country table.
  To get fast support, we need following details: Detail description, URL to reproduce problem, Screenshots