-1

I initially added a primary key column named id in my table, which was an auto-increment column - meaning it has AUTO_INCREMENT in it's 'Extra' value

Now the id column's value starts from 1. I want it to start from 100000 instead of 1 - how do I change the configuration of the id column to make it start the column data from 100000? What should the SQL query look like? Please guide... Thanks!

Sonal
  • 137
  • 2
  • 13
  • Read this post : [how-to-manually-set-seed-value-as-1000-in-mysql](https://stackoverflow.com/questions/1536065/how-to-manually-set-seed-value-as-1000-in-mysql) And This:[example-auto-increment](https://dev.mysql.com/doc/refman/8.0/en/example-auto-increment.html) – Mostafa NZ Jul 24 '22 at 06:00
  • Can I ask why?. – P.Salmon Jul 24 '22 at 10:18

1 Answers1

0

Use the alter table xxxxx auto_increment=xxx; statement:

create table test(id int primary key auto_increment);
alter table test  auto_increment=10000;
insert test values(default);
select * from test;
-- result set
10000
blabla_bingo
  • 1,825
  • 1
  • 2
  • 5