gpt4 book ai didi

java - 指定的 key 太长 - 最大 key 长度为 767 字节

转载 作者:可可西里 更新时间:2023-11-01 06:37:25 24 4
gpt4 key购买 nike

当我执行以下命令时:

create table assessment (
id integer not null auto_increment unique,
assignment_weight_type tinyint not null,
description varchar(255),
end_date datetime not null,
from_grade tinyint not null,
f_id tinyint not null,
name varchar(255) not null,
start_date datetime not null,
status tinyint not null,
weight smallint,
school_id integer not null,
school_year_id integer not null,
s_id integer, primary key (id),
unique (name, school_id, school_year_id, from_grade, f_id)
) ENGINE=InnoDB;

我收到此错误消息:

Specified key was too long; max key length is 767 bytes

我使用的是 utf8mb4 字符集。那么,为什么我会收到错误消息?

最佳答案

utf8mb4 每个字符最多使用四个字节,因此名称本身可能占用多达 1020 个字节。

关于java - 指定的 key 太长 - 最大 key 长度为 767 字节,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10748155/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com