change varchar()
it to varchar(10)
I believe you are missing the width of varchar
How to change datatype of primary key field in mysql workbench?
-
27-06-2022 - |
Question
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:
What is wrong?
Solution
OTHER TIPS
varchar() is an empty statement, seeking the width of the "string" that you are setting. You have to input the amount of characters to accept. (Ex: varchar(10) or varchar(45)).
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow