Problem/Motivation

Upgraded to 3.11: "The following updates returned messages panels module
Update #7309
Failed: PDOException: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes: ALTER TABLE {panels_allowed_types} ADD PRIMARY KEY (`module`, `type`); Array ( ) in db_add_primary_key() (linea 3027 di /web/htdocs/www.istitutosantelia.edu.it/home/includes/database/database.inc)."

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Santelia created an issue. See original summary.

Santelia’s picture

Component: Miscellaneous » Code
Priority: Normal » Major
nessunluogo’s picture

I have the same issue running db updates after upgrading to 7.x-3.11.

I tried changing MySQL DB version 5.7 in my containered development environment, but didn't solve.

Following some answers of this StackOverflow question, I tried changing the table engine from MyISAM to InnoDB and this worked for me.

The query you can run it on phpMyAdmin or any other SQL client:

ALTER TABLE `panels_allowed_types` ENGINE=InnoDB;

If you use a prefix, add it to the table name or just get it from the error message.

Of course, you need to run the Drupal DB Update again.

jaesperanza’s picture

This fixed the problem for me for the same error on an old D7 website. Thanks, @nessunluogo