Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Error Code: 1071. Specified key was too long

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/03 Report--

Error message

Error Code: 1071. Specified key was too long; max key length is 767 bytes

Table structure

CREATE TABLE yundou_data_ system.`object _ event` (`id`object (11) unsigned NOT NULL AUTO_INCREMENT, `object_ id`int (11) unsigned NOT NULL DEFAULT '0events, `event_ name` varchar (256C) NOT NULL DEFAULT'', `create_ time`int (11) unsigned NOT NULL DEFAULT '0questions, `status` tinyint (1) unsigned NOT NULL DEFAULT' 1records, PRIMARY KEY (`id`), UNIQUE KEY `unq_event_ name` (`event_ name`), KEY `idx_object_ id` (`object_ id`) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT=' object event table'

Reason

Mysql's varchar primary key only supports fields of no more than 767 bytes or 768 bytes, 384 bytes, or 767 bytes, while GBK is double-byte and UTF8 is three-byte.

Solution

`event_ name`varchar (255) NOT NULL DEFAULT''

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report