1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

MySQL duplicate entry error opon import to new server

Discussion in 'Programming/Internet' started by merlin, Sep 16, 2020.

  1. merlin

    merlin Guest

    I do have a DB on MySQL Galera 5.6.34 with a table that contains an index on ID,date. The table is fully functional and I have used repair and check to verify the table. However, upon backup/restore the importing DB-Server (MySQL 5.7.17, not Galera) tells me there is a duplicate entry and stops importing:

    gunzip < DB_170206_040001.sql.gz | mysql -u root -p staging

    ERROR 1062 (23000) at line 3800: Duplicate entry '329610-2011-03-27 03:00:00' for key 'user_id'

    If I empty that table prior to the backup, everything works fine.

    Is there a command to "ignore" upon import, or even better to resolve the problem at the live server?

    Login To add answer/comment

Share This Page