Mentioned in #34740.
$ sudo mysql -u root -p
MariaDB [(none)]> use nextcloud;
MariaDB [nextcloud]> set global innodb_large_prefix=on;
MariaDB [nextcloud]> set global innodb_file_format=Barracuda;
$ sudo -u www-data php occ maintenance:repair
That won’t work on shared hosting, where the DB might not be setup for it. Like at my hosting provider.
Nextcloud should handle it gracefully.