Duplicate key on write or update?

MysqlSql

Mysql Problem Overview


Duplicate key on write or update

First i will like to acknowledge the fact that, i have been to similar posts, but i couldn't find a way to solve this annoying issue which i face as of present.I am using mysql workbench and i keep getting this error.

  1. On workbench : ERROR: Error 1005: Can't create table 'database.path' (errno: 121)

  2. Use "Perror 121" on command line : MySQL error code 121: Duplicate key on write or update

At the end of the log, it shows 9 successful operations and 1 failure with only path table visible in the logs.

Any help and suggestion is welcomed.I think the mysql compiler doesn't really do a good Job when it comes to signifying the actual issue for debugging.

Mysql Solutions


Solution 1 - Mysql

Sorry guys, i found the problem. It is related to this post.

Which was hinted by rakeshjain.

It may be deleted as a duplicate post by admin.

The answer is, i had two CONTRAINTS on different tables with the same name:

CONSTRAINT Update_ID_fk --> Changed one and problem solved.

Solution 2 - Mysql

Your Foreign key names must be unique

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionuser3066913View Question on Stackoverflow
Solution 1 - Mysqluser3066913View Answer on Stackoverflow
Solution 2 - MysqlVahap GencdalView Answer on Stackoverflow