Search code examples
mysqldatabasemysql-workbenchsqldatatypes

How to change datatype of primary key field in mysql workbench?


In mysql workbench, I created a new table and added a column id, and by default its datatype is set to INT, PK and NN boxes are selected. When I tried to change the datatype of id column to VARCHAR(), it gave the following error:

enter image description here

What is wrong?


Solution

  • change varchar() it to varchar(10) I believe you are missing the width of varchar