0

I got an MySQL dump with ONLY insert statements. I tried to import it like this:

mysql> \. racktablesTabellen.sql

which always worked for me, till now because I got some errors I have to ignore. Can anybody tell me how to Ignore errors and just keep on with the entries when I got an sql dump with only insert statements ?

BoJack Horseman
  • 4,056
  • 9
  • 34
  • 67

1 Answers1

1

A possible solution is to remove the PRIMARY KEY from your table, import and add the PRIAMRY KEY again with ALTER IGNORE syntax.

blue
  • 1,954
  • 1
  • 10
  • 8
  • 2
    Your answer might work as well but I am too dumb to check the syntax xP I just did this in my vi :%s/INSERT/INSERT IGNORE worked I guess – BoJack Horseman Apr 03 '14 at 10:43
  • I did this based off previous comment: zcat db.sql.gz | sed -e 's/INSERT/INSERT IGNORE/' | mysql -u user -p dbname – develCuy Aug 30 '14 at 05:51