Storage capacity of TINYTEXT, TEXT, MEDIUMTEXT and LONGTEXT in MySQL Database

You can store text of various sizes in MySQL database. Although, VARCHAR formats are common for smaller text, mysql provides an alternative to store texts. Here are the different data type and their capacity.

  1. TINYTEXT – Can hold up to 255 bytes i.e. 255 characters with 1 byte overhead.
  2. SMALLTEXT – Can hold up to 64,535 characters which is equivalent to 64KB and requires 2 bytes overhead.
  3. MEDIUMTEXT – Can hold up to 16,777,215 characters i.e. 16MB and has 3 bytes overhead.
  4. LONGTEXT – Can hold up to 4,294,967,295 charactesr i..e. 4GB of text and has 4 bytes overhead.

If you would like to store your non-text files such as images etc., you can use BLOB format.

[My Video Promotion]
Tagged , , , . Bookmark the permalink.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.