MySQL Workbench 自动增量已禁用

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33602936/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 21:23:25  来源:igfitidea点击:

MySQL Workbench auto increment disabled

mysqlmysql-workbench

提问by Alexander Ivanov

I am using Workbench version 6.3.5 Community and this is GUI question only.

我使用的是 Workbench 6.3.5 版社区,这只是 GUI 问题。

When creating a new table auto increment check-box is disabled.
Is it a bug or I need to enable this some how in options?
And how to set start value and step for auto increment in GUI when creating a table?

创建新表时自动增量复选框被禁用。
这是一个错误还是我需要在选项中启用它?
创建表时如何在GUI中设置自动增量的起始值和步长?

workbench

工作台

回答by Lukas Ignatavi?ius

You need to set auto increment in tableenter image description here

您需要在表中设置自动增量在此处输入图片说明

回答by marchWest

As a work around, when you click the 'Apply' button and are presented with the generated script to review, you can actually edit that script. I ran into the issue you posted as well and just manually added AUTO_INCREMENT to the column definition I needed it applied to.

作为一种变通方法,当您单击“应用”按钮并看到生成的脚本以供查看时,您实际上可以编辑该脚本。我也遇到了你发布的问题,只是手动将 AUTO_INCREMENT 添加到我需要它应用的列定义中。

回答by connelblaze

Just check the AI(Auto Increment) checkbox. No work around, that's why it's a workbench. Life made easy

只需选中 AI(自动增量)复选框。没有解决办法,这就是为什么它是一个工作台。生活变得轻松

回答by Halil Saltik

You can do it this way

你可以这样做

enter image description here

在此处输入图片说明

Halil Saltik

哈利勒·萨尔提克

回答by Wole Ajala

Make sure the datatype is INT, not character based.

确保数据类型是 INT,而不是基于字符的。