Linux : Seafile Failed to init ccnet database: Specified key was too long

By | October 5, 2019

Encountered the following error during the Seafile installation process?

Error: Failed to init ccnet database: Specified key was too long; max key length is 767 bytes

Something went wrong while the installation script attempted to deploy the database.

Normally, InnoDB has a limitation of 767 bytes and 1000 bytes for MyISAM. Creating the database with “utf8” charset would workaround that issue.

Warning! Dropping the databases will remove existing data you may have in them. Since this example is about a new Seafile installation, this shouldn’t be an issue, but I just thought it worth mentioning for any inexperienced folks ending up reading this article.

You first need to drop the current databases, example :

drop database seafile_server;
drop database ccnet_server;
drop database seahub_server;

Then re-create them with utf8 charset, example :

create database seafile_server character set = 'utf8';
create database ccnet_server character set = 'utf8';
create database seahub_server character set = 'utf8';

Note : You should be good to launch the install script again (you will need first to clean the current leftover installation files before the script can be executed).