MySQL Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes Print

  • 0

PHP applications during installation or upgrades may state the following MySQL error:

SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 1000 bytes

When a MySQL table is MyISAM type, you cannot have indexes larger than 1000 bytes. You can resolve this by switching to InnoDB, which supports larger index sizes. Creating indexes on TEXT columns such as LONGTEXT and MEDIUMTEXT may have significant overhead and should be avoided.


Was this answer helpful?

« Back

Ready to get started? Build your site from
$2.24/mo
GET STARTED NOW