Error on installing: Specified key was too long; max key length is 1000 bytes

A Database Error Occurred
Error Number: 1071

Specified key was too long; max key length is 1000 bytes

ALTER TABLE ip_custom_fields MODIFY COLUMN custom_field_table VARCHAR(500);

Filename: /home/artxcent/public_html/igr/modules/setup/models/mdl_setup.php

Line Number: 94

You are also allowed to search on Google for errors. Found this 10 seconds after searching for it and it also applies for InvoicePlane too because itā€™s a MySQL-only error.

Hi there,

Thank you for your reply,

I saw the message but I donā€™t know what to do.

When I try to install InvoicePlane 1.46 it does not happen that error.

It happen with InvoicePlane 1.47.

What shoud I do?

in my browser the address is : http://igr.mydomain.com/index.php/setup/upgrade_tables

Sorry !

Sorry Kovah, but thats not an MySQL-error only.
As other user said, it just happens at new version.
storage_engine=ā€˜InnoDbā€™; is default at MySQL

please look if there is an error in the code of new version.

Thanks a lot!

Iā€™m not sure if this answer is really possible to execute, but I would suggest to convert to mariadb. https://seravo.fi/2015/10-reasons-to-migrate-to-mariadb-if-still-using-mysql

I havenā€™t had any problems using mariadb.

1 Like

most important question are you using 1.4.7 ?
no error at 1.4.6 !!!

Could you please post the exact MySQL Version you are using?
I have tested the installation with bith MariaDB and MySQL 5.5 and 5.6 and didnā€™t get such an error.

laurens: mariadb is better sorry, Oracle should not be supportet as all BIG FAT FINANCE CORPS
its seems to be newer version of mysql shipped with ubuntu 16.04 not working!

thanks a lot for the tip Kovah :smile:

I can confirm the issue. The error happens on MySQL 5.7 only (installed with Ubuntu 16.04).

This is because MySQL 5.7 has more strict check about the type.

VARCHAR(500); is not allowed, it should be TEXT or MEDIUMTEXT.

BTW, on 5.6, VARCHAR(500); is converted to a text field.

1 Like

This is pretty weird as the 5.7 manual states that varchar is allowed to have a length of 65,535.

Database tables was on MyISAM storage engine.

Migrating them to InnoDB ā€œsolvedā€ the issue: http://stackoverflow.com/a/9492183/1731473

I think you should specify the storage engine on SQL migrations files for first installation.

BTW, using MEDIUMTEXT directly would do the same thing with more inter-compatibility.

Fixed: https://development.invoiceplane.com/browse/IP-432