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


#1

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


#2

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.


#3

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 !


#4

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!


#5

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.


#6

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


#7

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.


#8

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:


#9

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.


#10

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


#11

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.


#12

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


closed #13