00 Votes

MySQL: Text field can only store 65535 characters

Question by Compi | Last update on 2021-02-22 | Created on 2019-06-13

I am using a field of data type "TEXT" in my MySQL database to save texts. Unfortunately, I realized now that a field of type TEXT can only hold 65,535 characters. All remaining characters are simply cut off.

What can I do to save longer texts with MySQL? The type VARCHAR also seems to be not suitable, here the length seems to be limited to only 255 characters. Does somebody has any idea?

2Best Answer2 Votes

There are several TEXT data types in MySQL that can store different text lengths.

Here is a small overview:

TypeCharacters (Max)Size (Max)
TINYTEXT255255 Byte
TEXT65,53564 KB
MEDIUMTEXT16,777,21516 MB
LONGTEXT4,294,967,2954 GB

If the 65,535 characters of the TEXT type are not enough for you, you should use MEDIUMTEXT or LONGTEXT instead.
Last update on 2021-02-22 | Created on 2019-06-13

ReplyPositive Negative

Related Topics

Important Note

Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.


Ask your own question or write your own article on askingbox.com. That’s how it’s done.