Error while trying to initialise the database

I’m trying to install a fresh nextcloud. When I created the data dir in nextcloud and assign the right permission to the web server. I’m running the install command :

sudo -u apache php occ maintenance:install --database "mysql" --database-host HOST_DB --database-name DB_NAME  --database-user DB_USER --database-pass DB_PASS --admin-user admin --admin-pass SOME_PASS

And here the error message :

Error while trying to initialise the database: An exception occurred while executing 'CREATE TABLE oc_migrations (app VARCHAR(255) NOT NULL, version VARCHAR(255) NOT NULL, PRIMARY KEY(app, version)) DEFAULT CHARACTER SET UTF8 COLLATE utf8_bin ENGINE = InnoDB':

SQLSTATE[HY000]: General error: 1005 Can't create table 'DB_NAME.oc_migrations' (errno: -1)

I tried to install version 17, 18 and 20 I got the same result

1 Like