Installation issue: what specific privileges does the DB user require?

Nextcloud version (eg, 20.0.5): 25.0.1
Operating system and version (eg, Ubuntu 20.04): Debian GNU/Linux 10
Apache or nginx version (eg, Apache 2.4.25): nginx/1.22.0
PHP version (eg, 7.4): 8.1.12

The issue you are facing: when attempting to run the ./occ maintenance:install command to install nextcloud, i receive the error

          MySQL username and/or password not valid
           -> You need to enter details of an existing account.

Is this the first time you’ve seen this error? (Y/N): Yes, but it’s also the first time I’ve tried to install NextCloud 25.0.1

Steps to replicate it:

  1. Download nextcloud 25.0.1
  2. Untar into correct location
  3. Set up src/config/config.php making sure config_is_read_only is set to false and installed is set to false
  4. Run ./occ maintenance:install with all necessary options

IT appears my issue is identical to this github issue. The db and db user account were created for me. When checking my grants, I see that I do not have all privileges with the GRANT OPTION.

MariaDB []> SHOW GRANTS;
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Grants for <removed>                                                                                                                                                                                                     |
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| GRANT PROCESS ON *.* TO `<removed>`@`<removed>`                                                                                                                                                                                     |
| GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, EVENT, TRIGGER ON `<dbname>`.* TO `<removed>`@`<removed>` |

The solution I’ve seen in this community forum and in the github issue is to grant all privileges with option to the account, but in my situation, that is unlikely to be possible.

I’ve searched the docs but have been unable to locate the answer to this question: what specific privileges does the account need in order to be able to install NextCloud and is OPTION also required? Are there alternative options for installation that do not require all privileges with OPTION?

The documentation says the same.

https://docs.nextcloud.com/server/stable/admin_manual/configuration_database/linux_database_configuration.html

Sorry, i’m not seeing on the page you linked the minimum required privileges and if the grant option is required. There is nothing in relation to privileges mentioned in the Database Configuration → Requirements section. The only mention of priviliges is under Database Configuration → Parameters -->Configuring a MySQL or MariaDB database on how to create a user.

Unless the inferred documentation is that the minimum requires privileges is “everything” based on the how to create a user section. If so, may I suggest adding a section to the documentation under Database Configuration → Requirements that clearly indicates NextCloud will not run properly with out ALL privileges and the grant option?

CREATE DATABASE IF NOT EXISTS nextcloud CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci;
GRANT ALL PRIVILEGES on nextcloud.* to 'username'@'localhost';
FLUSH privileges;

The official instructions say to grant all privileges. I’m not a MySQL guru, so I can’t tell you in any more detail if it can work with lesser rights than indicated in the docs. I doubt it, and granting all privileges seems to be pretty standard among other applications.