开发者

auto_increment in MySQL - can I omit it?

开发者 https://www.devze.com 2022-12-25 04:37 出处:网络
I\'ve noticed that PHPmyAdmin creates the following SQL for table creation: CREATE TABLE something ( ...

I've noticed that PHPmyAdmin creates the following SQL for table creation:

CREATE TABLE something (
    ...
) auto_increment=1;

When I write a database creation script I don't use the auto_increment bit. From reading related questions here I understand that it determines the starting value for auto_increment value开发者_StackOverflow中文版s. But it is good practice to reset it to 1, or should I just leave it out of the SQL so that the default is used?


You can leave it out.

The default should be 1, but you can specify that part of the script to use a different seed.


It has no meaning, as long as you have unique id's. Don't worry about the value.

0

精彩评论

暂无评论...
验证码 换一张
取 消