Maximum key lenght exceeded for MySQL

0 views
Skip to first unread message

Klemen Slavič

unread,
Jul 29, 2008, 4:37:52 AM7/29/08
to Steer CMS Developers
When using default UTF-8 encoding on the server, the
`steercms_property` table's `model` key returns an SQL error:

[propel-sql-exec] Could not execute update [Native Error: Specified
key was too long; max key length is 1000 bytes]

This is due to MySQL's limitation on key lengths - UTF-8 characters
can be as long as 3 bytes, and the key length is therefore limited to
333 characters (1000/3). The actual length of the key is 355 (50 for
`model`, 50 for `model_id` and 255 for `name`). Taking out the `name`
column from the `model` key takes care of that error (shortening any
or all of the columns would also resolve this error).
Reply all
Reply to author
Forward
0 new messages