Reputation: 1
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 record 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.
Upvotes: 0
Views: 420
Reputation: 37576
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
Upvotes: 0
Reputation: 43850
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
Upvotes: 0
Reputation: 430
auto increment always accept the greater value than the maximum present value in your table
Upvotes: 1