0

I try to upload a mysql file from another server. But when i upload i get a white page when i upload .xml or .zip

I need to say that it is Magento.

when i upload .sql i get this error: Error SQL query:

--
-- Constraints for table `eav_entity_attribute`
--
ALTER TABLE  `eav_entity_attribute` ADD CONSTRAINT  `FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE` FOREIGN KEY (  `attribute_id` ) REFERENCES  `eav_attribute` ( `attribute_id` ) ON DELETE CASCADE ON UPDATE CASCADE ,
ADD CONSTRAINT  `FK_EAV_ENTITY_ATTRIBUTE_GROUP` FOREIGN KEY (  `attribute_group_id` ) REFERENCES  `eav_attribute_group` (  `attribute_group_id` ) ON DELETE CASCADE ON UPDATE CASCADE ;

MySQL said: Documentation

#1452 - Cannot add or update a child row: a foreign key constraint fails (geschenk_test.#sql-29b_7c74, CONSTRAINT FK_EAV_ENTITY_ATTRIBUTE_ATTRIBUTE FOREIGN KEY (attribute_id) REFERENCES eav_attribute (attribute_id) ON DELETE CASCADE ON UPDATE CASCADE)

peterm
  • 91,357
  • 15
  • 148
  • 157
Paisley
  • 1
  • 1
  • 2
  • In your sql file you must set FOREIGN_KEY_CHECKS = 0; Look [here][1] [1]: http://stackoverflow.com/questions/2429655/can-you-automatically-create-a-mysqldump-file-that-doesnt-enforce-foreign-key-c – Emi Aug 08 '13 at 08:38

1 Answers1

0
To restore a .sql file backup without constraint checking, simply add the following statements at the beginning of your .sql file:

SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT;
SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS;
SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION;
SET NAMES utf8;
SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;
SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;
SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO';
SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0;

At the end of the file, add the statements required to turn on constraint checking again:

SET SQL_MODE=@OLD_SQL_MODE;
SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS;
SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;
SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT;
SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS;
SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION;
SET SQL_NOTES=@OLD_SQL_NOTES;


Please refer this http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/restoring_a_backup_of_a_magento_database
Anil Gupta
  • 632
  • 4
  • 16