So a website that I've inherited had the AUTO_INCREMENT value for a particular table set to a value of 65536. The website is an online store, and this particular table is set for product variations. Well, we've finally hit 65,536 variations and cannot add anymore. I'm now getting an error of Duplicate entry '65535' for key 'PRIMARY'
I've found where to increase this value in phpMyAdmin, but I still get the same error. Is there something I'm doing wrong? Any advice would be mucho helpful.
Best Answer
If your auto increment column is of type
UNSIGNED SMALLINT
, then you'll have the 65535 limit. Changing the column type to likeUNSIGNED INT
should allow you up to 4294967295. You can useUNSIGNED BIGINT
if you need anything bigger.If this does not solve your problem, can you post your table structure, which you can get with the statement:
show create table <table name>