You can start the auto_increment for a given table at 1000 with a table option:
CREATE TABLE school.student(
...
) AUTO_INCREMENT=1000;
Note that the next id generated will be one greater than the table option is set to, so it will generate value 1001. If you want it to include the value 1000, set the table option AUTO_INCREMENT=999
.
Your other requirement is more difficult.
https://dev.mysql.com/doc/refman/8.0/en/replication-options-source.html#sysvar_auto_increment_increment says:
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.
In other words, if you set auto_increment_increment=2
, this will apply to all tables with an auto-increment column. It is not a per-table option.
You could set auto_increment_increment=2
as a session variable only before inserting into the student table, then set it back to the default before inserting to another table. That sounds like it will be error-prone, because you could forget to change the session variable.