MySQL Insert Failing with Duplicate Entry on Index

i think if you run this query

SELECT * FROM CV_YP.table WHERE phone_number = '2147483647' AND niche = 'fitness';

you will find more than 1 row, so I think its a violation of the unique index, so when the engine tries to check for uniqueness on the new data this error fire


I think your phone number isn’t 1231231234 right? and it’s a number greater than 2147483647 and you use phone_number data type as int

If that true I think you need to change the data type of the phone_number column because the max value of int is 2147483647 so when you insert the new number the engine sees it as the max value which is 2147483647 and try to insert it.

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top