MySQL Field Length description

Source: Internet
Author: User
Storage required for column types
Tinyint 1 byte
Smallint 2 bytes
Mediumint 3 bytes
Int 4 bytes
Integer 4 bytes
Bigint 8 bytes
Float (x) 4 if x <= 24 or 8 If 25 <= x <= 53
Float 4 bytes
Double 8 bytes
Double Precision 8 bytes
Real 8 bytes
Decimal (M, d) M bytes (D + 2, if m <D)
Numeric (M, d) M bytes (D + 2, if m <D)

Date and Time Type
Storage required for column types
Date 3 bytes
Datetime 8 bytes
Timestamp 4 bytes
Time 3 bytes
Year 1 byte

String type
Storage required for column types
Char (m) M bytes, 1 <= m <= 255
Varchar (m) L + 1 byte, where l <= m and 1 <= m <= 255
Tinyblob, tinytext L + 1 byte, here l <2 ^ 8
Blob, text L + 2 bytes, here l <2 ^ 16
Mediumblob, mediumtext L + 3 bytes, here l <2 ^ 24
Longblob, longtext L + 4 bytes, here l <2 ^ 32
Enum ('value1 ', 'value2',...) 1 or 2 bytes, depending on the number of enumerated values (maximum 65535)
Set ('value1 ', 'value2',...) 1, 2, 3, 4, or 8 bytes, depending on the number of set members (up to 64 members)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.