Handling duplicate keys

suggest change

Given the table Employee

id Name
3 Yooden Vranx

And the tab-separated file employee.txt:

1	Arthur Dent
2	Marvin
3	Zaphod Beeblebrox

--ignore skips rows whose key already exists. Existing rows stay as they are.

$ mysqlimport --ignore mycompany employee.txt
id Name
1 Arthur Dent
2 Marvin
3 Yooden Vranx

--replace deletes the old row and inserts the new one when the key already exists.

$ mysqlimport --replace mycompany employee.txt
id Name
1 Arthur Dent
2 Marvin
3 Zaphod Beeblebrox

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents