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

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -