Seafile CE 6.0.9 to 6.1.1 MySQL Error

The Seafile CE server on Ubuntu 16.04.2 was running version 6.0.9 with no prior issues. The upgrade to version 6.1.1 was attempted but incurred this error in the process:

This script would upgrade your seafile server from 6.0 to 6.1
Press [ENTER] to contiune

Updating seafile/seahub database …

[INFO] You are using MySQL
[INFO] updating seahub database…
[ERROR] Failed to execute sql: REFERENCES command denied to user ‘seafile’@‘localhost’ for table ‘institutions_institution’

Failed to upgrade your database

The server originated at version 4.0 and has received every minor and incremental upgrade through versions 4, 5 and 6.0 to this, 6.1.1, seemingly without a problem. Operationally no problems have been found or reported. The MySQL user seafile is the same as described in the manual ( and was created and tested manually. It is the user found in all Seafile config files.

Restoring from backup the upgrade was retried after elevating the MySQL user’s privileges. The upgrade completed successfully only after the user’s privileges were elevated to essentially root levels, after which they were restored back down again for server operation.

Anyone have any ideas why this error was encountered? Is this a database problem, a script error? I am concerned about future upgrades and the overall ‘health’ of the MySQL server.

-Thank you

It looks like the following foreign key needs the REFERENCES permission (

See also

I doubt that it has any negative effects on the operation after you ran the upgrade script with the seahub database user having sufficient permissions.

I’ve added a Github issue to document this for the future.

Thanks for the info. It’s a big help.

So far no issues operationally.