#1071 - Specified key was too long; max key length is 767 bytes

Permalink
I tried to import database to a server but I immediately encountered a problem with Php admin.

what i should do next?

-- Dumping structure for data_base.areapermissionassignments
CREATE TABLE IF NOT EXISTS `areapermissionassignments` (
`cID` int(10) unsigned NOT NULL DEFAULT '0',
`arHandle` varchar(255) COLLATE utf8mb4_unicode_ci NOT NULL,
`pkID` int(10) unsigned NOT NULL DEFAULT '0',
`paID` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`cID`,`arHandle`,`pkID`,`paID`),
KEY `paID` (`paID`),
KEY `pkID` (`pkID`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci

#1071 - Specified key was too long; max key length is 767 bytes

 
Gondwana replied on at Permalink Reply
Gondwana
This will be related to database character set (collation). c5's collation arrangements changed recently; you may need to update the collation for some/all tables in your database.

I don't know how.
Usernhfdy73 replied on at Permalink Best Answer Reply
Thanks!

Solution to the problem was update mysql 5.6 to 5.7
kspitzley replied on at Permalink Reply
kspitzley
Another solution is here:https://concrete5.slack.com/archives/CDJ4G93C3/p1567775808100800...

You need to convert the db to use utf8 encoding (NOT MB4), as the longest key for this is fine
export the whole db from source
find and replace utf8mb4 with utf8
then import the sql file