You see this article from HTTP://WWW.CNBLOGS.COM/AYANMWReprinted from: http://blog.csdn.net/daydreamingboy/article/details/6310907Analyze the length of the MySQL data typeMySQL has several data types that can limit the "length" of a type, with char (
MySQL常用指令,java,php程序员,数据库工程师必备。程序员小冰常用资料整理MySQL common commands (for reference)The most common display commands are:1. Display the list of databases.show databases;2. Display the data table in the library:Use MySQL;Show tables;3, display the
Next, I will provide a summary of mysql Data Types, that is, field types, including type descriptions and string lengths of different data types. I will introduce them below.
I. numeric type
Storage required for column typesTINYINT 1 byteSMALLINT 2
if the setting in an item is varchar (So, of course, the English isSo what about Chinese?Utf-8 in Chinese is 3 bytesSo, does this varchar (50) have only 16 characters to save? No, this is the case with MySQL, but not after 5.0.MySQL varchar (50)
What is the maximum length of int (11), and what is the maximum length of varchar in MySQL? What is the maximum length of int (11)?In the SQL statement, int represents the type of field you want to create, int represents an integer, and 11
This article introduces the character length and related parameters of the varchar data type in mysql. For more information, see this article.
This article introduces the character length and related parameters of the varchar data type in mysql. For
If a varchar is set in an item (50)
Well, that's 50 for English.
So what about Chinese?
Utf-8 Chinese occupies 3 bytes
So, is this varchar (50) Only save 16 characters?
MySQL varchar (50) in both Chinese and English, there are 50.
MySQL5
MySQL study NOTE _ summary of MySQL character type VARCHAR length knowledge bitsCN.com
MySQL study NOTE _ summary of MySQL character type VARCHAR length
I. VARCHAR storage and row length restrictions
1. in VARCHAR (N), N refers to the length of
Type of a value
Storage required for column typesTINYINT 1 bytesSMALLINT 2 bytesMediumint 3 bytesINT 4 bytesINTEGER 4 bytesBIGINT 8 bytesFLOAT (x) 4 if X FLOAT 4 bytesDOUBLE 8 bytesDOUBLE PRECISION 8 bytesReal 8 bytesDECIMAL (m,d) m bytes (d+2, if
In the version above MySQL5.0, the length of the varchar data type is supported to 65535, which means that 65,532 bytes of data can be stored, and the start and end bits take up 3 bytes, that is, data stored in a fixed text or blob format in 4.1 or
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.