How to restore data from MYSQL dump without any duplicate key errors?
Everytime I t开发者_开发问答ry restoring the dump, I get :
ERROR 1062 (23000) at line 10297: Duplicate entry 'spaß' for key 'PRIMARY'
I am trying to restore it using:
mysql -u root -ppassword database < 0719.sql
You could import the dump into a temporary table, than use an SQL statement to copy only rows from this temporary table which do are not found in the target table.
you should truncate or drop the table in which you get duplicates
i suggest you use the source command; it will not stop on duplicates. mysql -u myuser -pmypassword
use database mydatabase; source mysqlfile.sql; exit;
精彩评论