MySQL Database Migration fails with Specified key was too long max key length is 1000 bytes

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Symptoms

Getting error below inside fisheye-debug.log when migrating database to MySQL server:

1 2 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Specified key was too long; max key length is 1000 bytes at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

Cause

There is a known bug with MySQL related to MyISAM, the UTF8 character set and indexes that you can check here.

Resolution

  1. Make sure MySQL is configured with the InnoDB storage engine.

  2. Change the storage engine used by default so that new tables will always be created appropriately:

    1 set GLOBAL storage_engine='InnoDb';

    For MySQL 5.6 and later, use the following:

    mysql> SET GLOBAL default_storage_engine = 'InnoDB';

  3. And finally make sure that you're following the instructions provided in Migrating to MySQL.

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.