Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
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
Comment | File | Size | Author |
---|---|---|---|
errore aggiornamento database sito scuola.png | 57.89 KB | Santelia |
Comments
Comment #2
Santelia CreditAttribution: Santelia commentedComment #3
nessunluogo CreditAttribution: nessunluogo commentedI 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.
Comment #4
jaesperanza CreditAttribution: jaesperanza commentedThis fixed the problem for me for the same error on an old D7 website. Thanks, @nessunluogo