problem in auto_increment in mysql?
iam getting a problem in auto increment that is . I declared auto increment and off set values as 5, 14 respectively in /etc/my.cnf file. and in creation of a table i declared auto increment.upto here every thing is fine. but wen iam ading a reco开发者_如何学Crd it starts with 3 only.depending on auto_increment value the starting value in record is changing. it never starts with auto_increment value. please solve this problem. thanks in advance.
auto increment always accept the greater value than the maximum present value in your table
run this query on your table and you can set where the auto increment starts:
ALTER TABLE tbl AUTO_INCREMENT = 15;
or to any value you need
What do you get when you read your Auto-increment vars using:
SHOW VARIABLES LIKE 'auto_inc%'
Do you get the Values you set before?
notice that if the value of auto_increment_offset is greater than that of auto_increment_increment, the value of auto_increment_offset is ignored.
Read the Manual
精彩评论