I'm trying to switch one of my DB tables over to utf8mb4 from utf8_general_ci.
ALTER TABLE d4b80le1jha CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin
This brings up the following error:
1071 - Specified key was too long; max key length is 1000 bytes
I've read a number of answers about this error messages but can't seem to solve my problem. Most of them talk about defining new indexes, but not what to do about existing ones.
I've also tried running the following, as recommended here, which made no difference:
SET @@global.innodb_large_prefix = 1;
An aggrevating factor is probably that I am using varchar hashes as primary keys. This is a legacy feature outside of my control. I have not set explicit sizes on my indexes - I wonder if that's what I should be looking at.
Table:
Field Type Null Key Default
-------------------------------------------------------
id varchar(11) NO PRI NULL
link varchar(255) NO NULL
title varchar(255) NO NULL
description varchar(255) YES NULL
pubdate datetime NO NULL
img_url varchar(255) YES NULL
team_id varchar(11) NO MUL NULL
source_id varchar(11) NO NULL
hits int(11) YES NULL
Indexes:
Keyname Type Unique Packed Column Cardinality Collation Null
--------------------------------------------------------------------------------
PRIMARY BTREE Yes No id 13407 A No
Unique combo BTREE Yes No team_id A No
source_id A No
link 13407 A No