Указанный ключ был слишком длинным — максимальная длина ключа составляет 767 байт

Когда я выполнил следующую команду:

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.Так почему же я получил сообщение об ошибке?

7
задан Mathias Bynens 7 August 2012 в 06:49
поделиться