DBD::mysql::st execute failed: Duplicate entry '127' for key 1

M

mike

My autoincrement is stuck on entry 127.

My script tried to insert a new record and I got this entry

"DBD::mysql::st execute failed: Duplicate entry '127' for key 1 "

Yes id 127 aready exists. When 127 was created the pointer should have
moved to 128, but it didn't.

How do I change the autoincrement pointer in MySQL?

Mike
 
X

xhoster

mike said:
My autoincrement is stuck on entry 127.

My script tried to insert a new record and I got this entry

"DBD::mysql::st execute failed: Duplicate entry '127' for key 1 "

Do you have a Perl question?
Yes id 127 aready exists. When 127 was created the pointer should have
moved to 128, but it didn't.

Are you explicitly setting the field value to 127 but expecting MySQL to
override it with 128 anyway? If so, don't do that.
How do I change the autoincrement pointer in MySQL?

I don't know, but it would help if you would:
1) Include the actual thing that is causing the error.
2) Post it to the right group.


Xho
 
M

mike

Yes I posted it in: perl.dbi.users, but I didn't get a response there.

My auto_incrementer is not working. I manually deleted record 127 and
did a re-insert, it got 127 like it should, but did not set the pointer
to 128.
 
J

J. Gleixner

mike said:
Yes I posted it in: perl.dbi.users, but I didn't get a response there.

My auto_incrementer is not working. I manually deleted record 127 and
did a re-insert, it got 127 like it should, but did not set the pointer
to 128.

Your question is about MySQL, not perl.

I'd guess that your column is a 'tinyint' and it needs to be bigger.
 
M

mike

Again. I got no response there ....

Yes it is defined like:

post_id tinyint not null primary key auto_increment

How would the field being tinyint allow 127, but not 128?
 
T

Tad McClellan

mike said:


What again?

Please quote some context in followups like everyone else does!

I got no response there ....


That does not magically make it into a Perl question.

Database questions are off-topic in non-database newsgroups.

Please do not make any more off-topic posts here.

Yes it is defined like:

post_id tinyint not null primary key auto_increment

How would the field being tinyint allow 127, but not 128?


Ask Perl questions in the Perl newsgroup.

Ask database questions in a database newsgroup.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top