I am trying to move the site from my localhost to the server but um getting an error message that does not allow me to import the database:
ERROR 1452 (23000) at line 119329: Cannot add or update a child row: a foreign key constraint fails (`goodnews_magento`.`#sql-15b05_2226f`, CONSTRAINT `FK_CATALOG_EAV_ATTRIBUTE_ATTRIBUTE_ID_EAV` FOREIGN KEY (`attribute_id`) REFERENCES `eav_attribute` (`attribute_id`) ON DELETE CASCADE ON UPDA)
To solve the issue as you mentioned, Before import to the new database instance, let’s add below sql lines in the head content of the sql file you have exported:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
And re-import the sql file after your changing.
As Mall suggested, you can enter the code into the top of your SQL file (the file you exported from your localhost instance).
Once done, you import this modified SQL file to your live server.
Hope that helps.
I inserted the code and I am getting this error from the outset:
phpMyAdmin SQL Dump -- version 126.96.36.199 -- https://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Oct 26, 2016 at 09:50 AM -- Server version: 5.6.31 -- PHP Version: 5.6.25 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'phpMyAdmin SQL Dump
-- version 188.8.131.52
-- Host' at line 1
--phpMyAdmin SQL Dump -- already had — before it, I added another 2 (—-) and that did the trick.
—-phpMyAdmin SQL Dump
I managed to import the database by adding SET FOREIGN_KEY_CHECKS= “0”; do in need to change anything after the database has been imported?
Tried that -- MySQL returned an empty result set (i.e. zero rows). (Query took 0.0000 seconds.)
The message should be as this: http://i.prntscr.com/111deeeb08ad41209426144d9e74feb3.png
Hi Mall, as I was copying and pasting the query MySQL was not happy with that hence the reason it did not update it, after typing it worked a treat, thanks for ALL your help. SET FOREIGN_KEY_CHECKS=1;
I will, Thank you.
This question is now closed