title: Specified key was too long; max key length is 767 bytes
body: <p>I understand the InnoDB index max length is 767 bytes. </p>
  
  <pre><code>CREATE TABLE `user` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `email` varchar(254) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    .....
    `token` varchar(128) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
    `rank` int(11) NOT NULL,
    PRIMARY KEY (`id`),
    KEY `user_token_index` (`token`),
  ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  </code></pre>
  
  <p>I want to create a index on my email.</p>
  
  <pre><code>alter table agent add UNIQUE index idx_on_email (email);
  </code></pre>
  
  <p>But got the error message:</p>
  
  <blockquote>
    <p>Specified key was too long; max key length is 767 bytes.</p>
  </blockquote>
  
  <p>But the length of token column only 128 bytes, email is 254 bytes, not above 767 bytes. Hope anyone can help me! Thanks in advance!</p>