0

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.)

rfay
  • 9,963
  • 1
  • 47
  • 89
  • There are multiple workarounds: http://mysql.rjweb.org/doc.php/limits#767_limit_in_innodb_indexes – Rick James May 03 '18 at 01:14
  • Thanks @RickJames - all of those require changing the *database* though, right? In this context, it's hoped for not to change the database, because it pertains to a server environment but in ddev is just used for local dev. – rfay May 04 '18 at 01:58
  • Well, apparently the dump was taken from one version configured one way, then you are loading it onto another version, configured differently. My document gives you 5 choices; can't you do any one of them? – Rick James May 04 '18 at 02:53

1 Answers1

3

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
rfay
  • 9,963
  • 1
  • 47
  • 89