简体   繁体   中英

ddev import-db: Index column size too large. The maximum column size is 767 bytes

When using ddev import-db to import a production db dump for TYPO3 9 into a ddev project I had a mysql error:

"Index column size too large. The maximum column size is 767 bytes."

This seems to be the result of importing a regular utf8 charset db into ddev, which is set up for utf8mb4, using 4 bytes for character, and overrunning the index column size.

What's the solution? (Besides changing the column definition, changing my prod site and db, etc.)

This issue was originally discussed and solved in https://github.com/drud/ddev/issues/654

There is now a way to override the default mysql setting in ddev.

The example MariaDB/mysql override docs show exactly this example.

In your project's .ddev/mysql directory, add a file called utf8ci.cnf (or whatever you want it to be called, as long as it ends in .cnf) with these contents:

[mysqld]
collation-server = utf8_general_ci
character-set-server = utf8
innodb_large_prefix=false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM