MySQL data type maximum length record

Source: Internet
Author: User

Range of values for each data type in MySQL

Turn around here and write it down slowly.

TINYINT
-128-127
TINYINT UNSIGNED
0-255
SMALLINT
-32768-32767
SMALLINT UNSIGNED
0-65535
Mediumint
-8388608-8388607
Mediumint UNSIGNED
0-16777215
INT or INTEGER
-2147483648-2147483647
INT UNSIGNED or INTEGER UNSIGNED
0-4294967295
BIGINT
-9223372036854775808-9223372036854775807
BIGINT UNSIGNED
0-18446744073709551615
FLOAT
-3.402823466E+38- -1.175494351e-38,0,1.175494351e-38-3.402823466e+38
double or double PRECISION or REAL
-1.7976931348623157E+308- -2.2250738585072014e-308,0,2.2250738585072014e-308-1.7976931348623157e+308
decimal[(M,[d]) or NUMERIC (m,d)
Determined by M (the length of the entire number, including the decimal point, the number of digits to the left of the decimal point, the number of digits to the right of the decimal point, but excluding the minus sign) and D (the number of digits to the right of the decimal), m defaults to 0 for the 10,d default
DATE
1000-01-01-9999-12-31
DATETIME
1000-01-01 00:00:00-9999-12-31 23:59:59
TIMESTAMP
1970-01-01 00:00:00-One day in 2037 (specifically, I don't know, hehe)
Time
-838:59:59 ' to 838:59:59
year[(2|4)]
Default is 4-bit format, 4-bit format value range is 1901-2155,0000,2 bit format value range is 70-69 (1970-2069)
CHAR (m) [binary] or NCHAR (m) [binary]
The range of M is 1-255, and if there are no binary entries, it is not case-nchar indicates that the default character set is used. A space is filled in the database, but the space at the end of the removal is automatically removed.
[National] VARCHAR (M) [BINARY]
The range of M is 1-255. The space at the end of the database is automatically removed.
Tinyblob or Tinytext
255 (2^8-1) characters
BLOB or TEXT
65535 (2^16-1) characters
Mediumblob or Mediumtext
16777215 (2^24-1) characters
Longblob or Longtext
4294967295 (2^32-1) characters  
enum (' value1 ', ' value2 ',...)  
can have a total of 65,535 different values  
set (' value1 ', ' value2 ',...)  
a maximum of 64 members  

Reference: http://wayne173.iteye.com/blog/1631095

MySQL data type maximum length record

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.