1

Topic: Update iRedAPD-2.6: MySQL error

==== REQUIRED BASIC INFO OF YOUR IREDMAIL SERVER ====
- iRedMail version (check /etc/iredmail-release): 0.9.9
- Deployed with iRedMail Easy or the downloadable installer? No.
- Linux/BSD distribution name and version: Debian 8 Jessie
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL 5.6.39
- Web server (Apache or Nginx): Nginx
- Manage mail accounts with iRedAdmin-Pro? No.
- [IMPORTANT] Related original log or error message is required if you're experiencing an issue.
====

Hello.

Trying to update iRedAPD to 2.6 (following https://docs.iredmail.org/upgrade.iredapd.html) I've got just 1 error:

ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes

Inspected this issue I've found that table srs_exclude_domains was not created  in the iredapd database.

Using console I've added this table:

CREATE TABLE srs_exclude_domains (
    ->     id      SERIAL PRIMARY KEY,
    ->     domain  VARCHAR(255) NOT NULL DEFAULT ''
    -> );

But after next command:

CREATE UNIQUE INDEX idx_srs_exclude_domains_domain ON srs_exclude_domains (domain);

I've got the mentioned error again:

ERROR 1071 (42000): Specified key was too long; max key length is 767 bytes

If this could help this some params from my.cnf:

default_storage_engine = InnoDB
character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

Can you help me fix it?

Thank you for great support.

----

Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.

2

Re: Update iRedAPD-2.6: MySQL error

Mysql 5.6 and prior versions have the index key prefix length limit of 767 bytes. You will hit this limitation with utf8mb4 unique indexes longer than 191 characters.

3

Re: Update iRedAPD-2.6: MySQL error

Possible solutions:

- Shorten the length of "srs_exclude_domains.domain" to, e.g. 200.
- Upgrade MySQL to a newer version.

4

Re: Update iRedAPD-2.6: MySQL error

ZhangHuangbin wrote:

Possible solutions:

- Shorten the length of "srs_exclude_domains.domain" to, e.g. 200.
- Upgrade MySQL to a newer version.

In this case 200 is too big, max length is 191.
Another solution is enabling the innodb_large_prefix configuration option.
More info: https://dev.mysql.com/doc/refman/5.6/en … tions.html

5

Re: Update iRedAPD-2.6: MySQL error

Thank you guys. That helped.