MySQL index too long 1071-max key length is 767 byte

Source: Internet
Author: User
Tags mysql index
Issue create Table:specified Key was too long; Max key length is 767 bytes reason database table is UTF8 encoded, where varchar (255) column has a unique key index and MySQL by default the index of a single column cannot exceed 767 bits (different versions may differ) So UTF8 character encoding, 255*3 byte exceeds the limit resolution 1 using INNODB engine, 2 enable Innodb_large_prefix option, extend constraint to 3072byte;3 re-create database; MY.CNF configuration: Default-storage-engine=innodbinnodb_large_prefix=on in General, it is not recommended to use such a long index, the performance has a certain impact ; Reference Document: https:// Dev.mysql.com/doc/refman/5.5/en/innodb-restrictions.html

MySQL index too long 1071-max key length is 767 byte

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.