0

Is it possible to add auto-increment-increment by 10 for only one table in mysql?

I have a testing db that has a lot of tables that do not abide by the auto-increment-increment of 10. I won't want to mess up my testing rig.

The production server has auto-increment-increment of 10.

0

According to the MySQL documentation, you can't set custom auto-increment value for a specific table.

It is not possible to restrict the effects of these two variables to a single table; these variables control the behavior of all AUTO_INCREMENT columns in all tables on the MySQL server.

However, this value has both global and session level effect. You may set it for session level and can perform required tests. And the changes will not persist after restarting your database server.

Reference: auto_increment_increment

  • Looks like docker will need to save the day when testing this setup. Thanks! – cph Feb 5 '17 at 5:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.