I\'ve written a MySQL script to create a database for hypothetical hospital records and populate it with data. One of the tables, Department, has a column named Description,
For me, I defined column type as BIT (e.g. "boolean")
When I tried to set column value "1" via UI (Workbench), I was getting a "Data too long for column" error.
Turns out that there is a special syntax for setting BIT values, which is:
b'1'
Very old question, but I tried everything suggested above and still could not get it resolved.
Turns out that, I had after insert/update trigger for the main table which tracked the changes by inserting the record in history table having similar structure. I increased the size in the main table column but forgot to change the size of history table column and that created the problem.
I did similar changes in the other table and error is gone.
Change column type to LONGTEXT
I try to create a table with a field as 200 characters and I've added two rows with early 160 characters and it's OK. Are you sure your rows are less than 200 characters?
Show SqlFiddle
in mysql if you take VARCHAR
then change it to TEXT
bcoz its size is 65,535
and if you can already take TEXT
the change it with LONGTEXT
only if u need more then 65,535
.
total size of LONGTEXT
is 4,294,967,295
characters
Varchar has its own limits. Maybe try changing datatype to text.!