Seafile-server-installer 6.1.2 fails on database creation on Ubuntu 16.04

This is my first installation of Seafile but I a competent Linux sysadmin so I’m annoyed that I can’t figure this one out.

The script is trying to connect to the DB using the hostname rather than ‘localhost’ and so barfs.

I’ve tried running the script in auto mode with the -i and -o switches to no avail.

I’ve even tried hardcoding 127.0.0.1 into the Python script.

The error message is
Failed to connect to mysql server using user “seafile” and password “***”: Host ‘XXX.XXX.XXX’ is not allowed to connect to this MariaDB server

Please can someone help me out here?!

BTW I can log into the DB server as root and can see that the seafile user has been created.

Your seafile database user has no access to the database. You need to grant access for the host XXX.XXX.XXX

Thanks.

Unfortunately it turns out that my entire DB is now corrupt so now I have the fun task of rebuilding a server :cry: