Database migration fails due to duplicate entry
症状
Error message when migrating the database (e.g. from HSQL to MySQL):
...
76329 rows written, 40 tables completed.
76336 rows written, 41 tables completed.
Database error at cru_user:121 (table:row) of the input: Duplicate entry 'abc' for key 2
Duplicate entry 'abc' for key 2
Database migration failed: java.sql.BatchUpdateException: Duplicate entry 'abc' for key 2
原因
This problem can occur if:
- the target database is case insensitive.
- the target database has not been created with the correct collation.
ソリューション
If the collation
column is not shown as utf8_bin
, you need to recreate the database with the correct collation. For more information, refer to our database migration documentation.
最終更新日 2015 年 6 月 8 日
Powered by Confluence and Scroll Viewport.