禁用 MySQL 工作台自动增量

我使用的是 Workbench 版本6.3.5 Community,这只是 GUI 问题。

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

workbench

82964 次浏览

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.

You need to set auto increment in tableenter image description here

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

You can do it this way

enter image description here

Halil Saltik

Make sure the datatype is INT, not character based.

If you are like me, and you are wondering how on earth to get to that primary-key, auto-increment checkbox etc:

  • Hover over the table name, in my example "persons"
  • A "spanner like icon" will appear
  • Click on it and that's it!

enter image description here



I am using MySQL Workbench 8.0 CE(v8.0.19)

The field must be both datatype int and the primary key for the table.