Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6869581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T03:34:32+00:00 2026-05-27T03:34:32+00:00

i am trying to import a sql dump of magento along with some product

  • 0

i am trying to import a sql dump of magento along with some product data and i get this foreign key constraint error:

`ERROR 1452 (23000) at line 231680: Cannot add or update a child row: a foreign key constraint fails:
`magento`.`#sql-b33_27`, CONSTRAINT `FK_CATALOG_COMPARE_ITEM_CUSTOMER_ID_CUSTOMER_ENTITY_ENTITY_ID` FOREIGN KEY (`customer_id`) REFERENCES `customer_entity` (`entity_id`) ON DELETE CASCADE ON )`

This is the sql code which is causing the error :

--
-- Constraints for table `catalog_eav_attribute`
--
ALTER TABLE `catalog_eav_attribute`
  ADD CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV_ATTRIBUTE_ATTRIBUTE_ID` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDATE CASCADE;

I am not very comfortable with sql queries. Could some one please explain me what this query does and guide me to resolve this? Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T03:34:32+00:00Added an answer on May 27, 2026 at 3:34 am

    You are trying to add a record into catalog_eav_attribute, but you do not have a corresponding record in eav_attribute that matches on attribute_id

    If you are also inserting bulk data into eav_attribute, I would recommend doing that first, and then the data would be in the table before the foreign key on catalog_eav_attribute needed to reference it.

    This article discusses how you can use:

    SET FOREIGN_KEY_CHECKS = 0;
    --Do your update here
    SET FOREIGN_KEY_CHECKS = 1;
    

    If you cannot change the order that you are inserting data. You just have to make sure your data follows the Foreign Keys once everything has been inserted into the database, before you can re-enable the FOREIGN_KEY_CHECKS

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to import IIS logs into SQL Server 2008. I get this error
I am trying to import some data to SQL Server 2008 by means of
I'm trying to import some data from Excel to SQL Server, I have a
I'm trying to import some data (using oracle sql developer) from a .csv file
I’m trying to import fixed width data from text file into SQL Server Express
I am trying to import data from excel file (.xlsx) into sql database, my
I'm trying to import a csv (that is a data extract from a SQL
I'm trying to import an sql dump into mysql. I selected in command prompt
I am trying to import data from a CSV file to a SQL Server
I am trying to import data from a utf-8 encoded flat file into SQL

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.