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 ?

2
  • Primary Key duplicate errors. Basically I just want to ignore them and keep on with the other entries. Commented Apr 3, 2014 at 10:08
  • But how can I put that IGNORE in there ?? It's just got a dump with thousands of lines with INSERT statements Oo Commented Apr 3, 2014 at 10:11

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

2 Comments

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
I did this based off previous comment: zcat db.sql.gz | sed -e 's/INSERT/INSERT IGNORE/' | mysql -u user -p dbname

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.