mysql - Add from the 5th value -
the goal
add 5th value.
the problem
there table on database called markets. within it, there 5 values:
+----+------+ | id | name | +----+------+ | 0 | null | +----+------+ | 1 | | +----+------+ | 2 | b | +----+------+ | 3 | c | +----+------+ | 4 | d | +----+------+ id primary key , auto-incremented column , start 0 (i added manually use default). when add market table, seems mysql adds market in question 0 id — , want set id 5 continue table's logic. ask: how can add value 5th id?
what i've tried
i set auto_increment value 5, without success. query used following:
alter table `markets` auto_increment = 5; how know mysql attempting add market id 0?
my application powered c# throwing exception:
duplicate entry '0' key 'primary'
on insert statement, leave auto_increment field out of statement. leave mysql increment , add automatically.
Comments
Post a Comment