A
A
Alexey2015-12-18 00:03:36
PHP
Alexey, 2015-12-18 00:03:36

How to find Duplicate entry cause in mysql?

Hello! Mysql error constantly pops up when adding a record to the database, like this: Duplicate entry '' for key 2
How to find the reason for which field is duplicated?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
W
wol_fi, 2015-12-18
@dzheka3d

SHOW INDEX FROM table_name where Non_unique = 0;
will print all unique indexes in the table.

D
Dmitry, 2015-12-18
@thewind

Take a look at the composite unique indexes that have been created and you'll see what's going on.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question