title: How to resolve "specified key was too long max key length is 255 bytes" in mysql?
body: <p>Whenever i fire this query from one of the mysql client (emma):</p>
  
  <pre><code>CREATE TABLE `tbl_mappings` (
    `id` int(11) unsigned NOT NULL AUTO_INCREMENT,
    `private_id` int(11) unsigned NOT NULL,
    `name` tinytext NOT NULL,
    PRIMARY KEY (`id`),
    UNIQUE KEY `name` (`private_id`,`name`(255)),
    KEY `FK_tbl__private_integrations_mappings_tbl__private_integrations` (`private_id`),
    CONSTRAINT `FK_tbl__private_integrations_mappings_tbl__private_integrations` FOREIGN KEY (`private_id`) REFERENCES `tbl__private_integrations` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  </code></pre>
  
  <p>i get error : specified key was too long max key length is 255 bytes</p>
  
  <p>i am using mysql server 5.7,ubuntu 16.04</p>
  
  <p>And i have tried adding configuration in my.cnf under [mysqld] :</p>
  
  <pre><code>innodb_file_format=barracuda
  innodb_file_per_table=1
  innodb_large_prefix=1
  init_connect='SET collation_connection = utf8mb4_unicode_ci'
  init_connect='SET NAMES utf8mb4'
  character-set-server=utf8mb4
  collation-server=utf8mb4_unicode_ci
  default-storage-engine=InnoDB
  </code></pre>
  
  <p>And then restarted mysql service .still it wont work.</p>
  
  <p>Any help is appreciated.
  Thank you.</p>