На локальном сервере возникает такая ошибка при попытке сменить кодировку и сопоставление таблицы на utf8mb4, а на удаленном - нет. Причину ошибки я знаю, мне интересно ,почему поведение различается. Локальный mysql - 5.5.45, удаленный - 5.5.55.
Судя по ответам на похожий вопрос в английской версии SO в INNODB движке (вплоть до версии MySQL 5.5.14) существуют следующие ограничения на длину поля с уникальным ключем:
INNODB utf8 VARCHAR(255)INNODB utf8mb4 VARCHAR(191)сравните sysvar_innodb_large_prefix параметр в обеих БД
Enable this option to allow index key prefixes longer than 767 bytes (up to 3072 bytes), for MyISAM tables that use DYNAMIC or COMPRESSED row format. (Creating such tables also requires the option values innodb_file_format=barracuda and innodb_file_per_table=true.) See Section 14.11.8, “Limits on MyISAM Tables” for maximums associated with index key prefixes under various settings.
For tables that use REDUNDANT or COMPACT row format, this option does not affect the permitted index key prefix length. When this setting is enabled, attempting to create an index prefix with a key length greater than 3072 for a REDUNDANT or COMPACT table causes an ER_INDEX_COLUMN_TOO_LONG error.
Сборка персонального компьютера от Artline: умный выбор для современных пользователей