What is the difference between the MySQL type varchar () and the text? Workaround

Source: Internet
Author: User
Tags mysql text
What is the difference between the MySQL type varchar () and the text?
What is the difference between the MySQL type varchar () and the text?

When are they used separately??

------Solution--------------------
1)
VARCHAR l+1 bytes, where l<=m and 0 <=m<= 65535
TEXT l+2 bytes, where l< 216
2)
1. Use varchar as much as possible
2. More than 255 bytes can only be used with varchar or text
3. Where you can use varchar without text
------Solution--------------------
Support the upstairs. One thing to add: when you have more general descriptive text, use text as much as possible. Using text, the fuzzy query does not affect the speed.
------Solution--------------------
cite the landlord Sf_kirk post:
What is the difference between the MySQL type varchar () and the text?

When are they used separately??

------Solution--------------------
The maximum length of the MySQL varchar is only 255.
If you want to use a varchar greater than 255, you have to use the MySQL text type.
------Solution--------------------
varchar is a restricted store text unrestricted storage, that is, text can store the varchar does not necessarily line, but varchar can store the text can certainly

Professional training jee,java,jsp, lamp series Architecture
Contact QQ492236022
------Solution--------------------
Apart from the difference in capacity, the biggest difference is in the index
------Solution--------------------
All the talk is upstairs, I'm here to pick up the points.
------Solution--------------------
discuss
Apart from the difference in capacity, the biggest difference is in the index

------Solution--------------------
VARCHAR is 256 characters in
Text is 65,536 characters in a
  • 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.