What's the difference between VARCHAR(255) and TINYTEXT string types in MySQL?

后端 未结 3 1301
再見小時候
再見小時候 2020-12-04 23:39

What\'s the difference between VARCHAR(255) and TINYTEXT string types in MySQL?

Each of them allows to store strings with a maximum length of 255 characters. Storage

3条回答
  •  生来不讨喜
    2020-12-05 00:18

    Using VARCHAR you can set the column to NULL or NOT NULL and you can set DEFAULT value, but not with TEXT. Use VARCHAR if you need one or both feature, NULL and DEFAULT.

提交回复
热议问题