Mysql with Entity framework Code First ID skipping 10

Asked

Viewed 154 times

1

I’m setting up a Mysql in the Azure for an application I’m working on, however while saving my records to identity column is increasing by 10 by 10.

This would be an Entity adjustable setting or an adjustment made to all tables directly in the database?

In case, what and how I should change this option so that auto increments only 1?

  • Solved the problem?

  • Azure has no Mysql service, it is outsourced by a company called Cleardb, and on their free plan, only offer default installation and medium-Thrust. So if you want to use it for free, there’s not much to do. However, you can upload a small VM, install Mysql on it and use it as your database server and configure as you wish.

1 answer

0

There is a variable that controls this: autoincrement

See if you can identify her value like this:

SELECT Auto_increment FROM information_schema.tables WHERE table_name='the_table_you_want';

To change would be so:

SET @@auto_increment_increment=1;

Look at this one

Browser other questions tagged

You are not signed in. Login or sign up in order to post.