0

I am trying to import(with bigdump) my live database to an test database. While importing the tables to the test database im getting the following error.

MySQL: Cannot add or update a child row: a foreign key constraint fails (DB_Name.catalog_product_entity, CONSTRAINT FK_CAT_PRD_ENTT_ATTR_SET_ID_EAV_ATTR_SET_ATTR_SET_ID FOREIGN KEY (attribute_set_id) REFERENCES eav_attribute_set (attribute_set_id) ON )

I have set the SET Foreign_Key_Checks but it seems this isn't changing the error at all.

SET FOREIGN_KEY_CHECKS = 0;
//Code
SET FOREIGN_KEY_CHECKS = 1;

Do I need to change table names? What am I doing wrong?

1 Answer 1

1

I had the same problem. I ended importing my MySQL database dump using SSH.

This could be done like this:

  1. Upload the SQL file to the server.
  2. If the database does not exist please create one with an user. Note the username and password.
  3. Log into the server through SSH
  4. Navigate to the directory where your .sql file is.
  5. Type this this command: mysql -uUSERNAME -p DATABASE_NAME < data.sql

This works for me and it is also much faster.

9
  • Thanks for your fast response. You are talking about SSH but i never used it before, do i need to install some program or call my provider?
    – JurreT
    Commented Feb 23, 2015 at 13:47
  • I use PuTTY as my SSH Client.
    – knospe
    Commented Feb 23, 2015 at 13:58
  • Aha found it! I am going to try it right now :)
    – JurreT
    Commented Feb 23, 2015 at 14:02
  • New error has occured: ERROR 2002 (HY000): Did you ever have this error?
    – JurreT
    Commented Feb 23, 2015 at 14:12
  • 1
    Maybe this will help you.
    – knospe
    Commented Feb 23, 2015 at 14:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.