BLOB column 'on' can not have a default value (default)

1

When trying to keep a column as null, mediumText , and add a value 'as defined', it returns:

  

BLOB column 'over' can not have a default value

Why can not I? What are the implications of this? How can I resolve this to allow an optional column in MySQL of type mediumText (or one that suits the need) and has a default value like "Do not talk too much", for example?

    
asked by anonymous 21.11.2017 / 18:06

1 answer

1

What would be the default value for a BLOB since it can contain anything?

Not being able to set a default value can not use this clause in this type of column.

On the other hand if the column accepts nulls, then the default value is easy, NULL is the default and you can use it, a solution is to use NULL , but I would only do this if you need this else, columns that allow nulls to be avoided, I would not use just to let them have a default value. And neither is the value you want.

If you want to put text, then put the appropriate type. Just understand that TEXT is the same as BLOB and does not accept default value.

You may think you should be able to put text, but found that conceptually it did not make sense. Some people disagree.

Documentation .

    
21.11.2017 / 18:43