开发者

auto_increment in MySQL - can I omit it?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜