Skip to content

Instantly share code, notes, and snippets.

@kerimdzhanov
Last active December 28, 2015 21:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kerimdzhanov/7566853 to your computer and use it in GitHub Desktop.
Save kerimdzhanov/7566853 to your computer and use it in GitHub Desktop.
MySQL data types size reference tables

Textual types

      Type | Maximum length | Size (bytes)
-----------+----------------+------------------
  TINYTEXT |            255 | (2^8−1)
      TEXT |         65,535 | (2^16−1) = 64 KiB
MEDIUMTEXT |     16,777,215 | (2^24−1) = 16 MiB
  LONGTEXT |  4,294,967,295 | (2^32−1) =  4 GiB

reference: http://dev.mysql.com/doc/refman/5.5/en/string-types.html

Numeric types

      Type |   Min value (signed) |  Max value (signed) | Max value (unsigned) | Size
-----------+----------------------+---------------------+----------------------+---------
   TINYINT |                 -128 |                 127 |                  255 | 1 byte
  SMALLINT |               -32768 |               32767 |                65535 | 2 bytes
 MEDIUMINT |             -8388608 |             8388607 |             16777215 | 3 bytes
       INT |          -2147483648 |          2147483647 |           4294967295 | 4 bytes
    BIGINT | -9223372036854775808 | 9223372036854775807 | 18446744073709551615 | 8 bytes

reference: http://dev.mysql.com/doc/refman/5.5/en/integer-types.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment