MySQL String type

Source: Internet
Author: User
The string type char and Varchar1, char (m) m are the maximum length of the string, and the length is any value between 0~255 bytes, occupying a fixed byte. 2, varchar (M) length is any value between 0~65535 bytes. The actual number of bytes is based on the actual character length plus 1, because there is a last terminator that occupies one byte. 3, char and varchar the last space in the string, char does not preserve space, varchar reserved space. 4. If the length of the insertion string exceeds the limit, you will be prompted not to insert the text type tinytext allowed length 0~255 bytes Storage value length + 2 bytes text  allowed length 0~65535 bytes storage space is the length of the value + 2 bytes Mediumtext  allow length 0~167772150 bytes storage to the length of the value + 3 bytes longtext  allow length 0~4294967295 bytes storage to the length of the value + 4 bytes Enum type format: property name Enum (' Value 1 ', ' Value 2 ', ..., ' value n '); Values can be up to 65,535, spaces at the end of these values will be deleted directly from the system, and the characters inserted into the table can only be strings that are qualified in the enum. If a NOT null limit is added, inserting a null value is not allowed, if the insert value is not specified, the default insertion value is 1. If the not NULL limit is not specified, then no insertion value or null is inserted, and the inserted null is displayed. Set type format: property name Set (' Value 1 ', ' Value 2 ',..., ' value n '); The spaces at the end of these values will be deleted directly by the system, and the characters inserted into the table can only be a qualified string in the enum, which may be combined with multiple values, with multiple values separated by commas with a maximum of 64 values. such as insert: The Set Type value table is (' A ', ' B ', ' C ', ' d '), the insertion value is (' B ') and (' A,c,d '). Displays B and a,c,d.

MySQL String type

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.