I can create a table using collation utf8_general_ci
but it fails with collation utf8mb4_general_ci
-- throws error:
#1071 - Specified key was too long; max key length is 1000 bytes
Here are the two MySQL queries -- they are identical except for the COLLATION. The first one works, the second throws the above 1071 error:
CREATE TABLE tng_addresses (
addressID INT(11) NOT NULL AUTO_INCREMENT,
address1 VARCHAR(64) NOT NULL,
address2 VARCHAR(64) NOT NULL,
city VARCHAR(64) NOT NULL,
state VARCHAR(64) NOT NULL,
zip VARCHAR(10) NOT NULL,
country VARCHAR(64) NOT NULL,
www VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
phone VARCHAR(30) NOT NULL,
gedcom VARCHAR(20) NOT NULL,
PRIMARY KEY (addressID),
INDEX address (gedcom, country, state, city, address1)
) ENGINE = MYISAM COLLATE utf8_general_ci
this fails:
CREATE TABLE tng_addresses (
addressID INT(11) NOT NULL AUTO_INCREMENT,
address1 VARCHAR(64) NOT NULL,
address2 VARCHAR(64) NOT NULL,
city VARCHAR(64) NOT NULL,
state VARCHAR(64) NOT NULL,
zip VARCHAR(10) NOT NULL,
country VARCHAR(64) NOT NULL,
www VARCHAR(100) NOT NULL,
email VARCHAR(100) NOT NULL,
phone VARCHAR(30) NOT NULL,
gedcom VARCHAR(20) NOT NULL,
PRIMARY KEY (addressID),
INDEX address (gedcom, country, state, city, address1)
) ENGINE = MYISAM COLLATE utf8mb4_general_ci
The only difference is the collation. Any ideas as to why?
System info:
Apache Version: 2.4.17 (Win32) OpenSSL/1.0.2d PHP/5.6.19
PHP Version: 5.6.19
mySQL Version: 5.5.5-10.1.10-MariaDB