Nextcloud install fails with wrong mysql user

Nextcloud version (eg, 12.0.2): 13
Operating system and version (eg, Ubuntu 17.04): Ubuntu 18.04 / OVH host in France
Apache or nginx version (eg, Apache 2.4.25): Apache 2.4.29
PHP version (eg, 7.1): 7.2
mysql: 5.7.22-0ubuntu18.04.1

The issue you are facing:
the install page doesnt connect to mysql database.
i created the DB and an user specifically for nextcloud, and flushed the rights. but there is the error shown after submit of the form:


Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1045] Access denied for user ’ oc_super_admin_t’@‘localhost’ (using password: YES)
Security warning

Your data directory and files are probably accessible from the internet because the .htaccess file does not work.
For information how to properly configure your server, please see the documentation.

“oc_super_admin_t” is not the user to connect to mysql i created and entered in the install form. that is very weird.

Is this the first time you’ve seen this error? (Y/N): N
i already face that in fresh ubuntu installs before

Steps to replicate it:

  1. fresh ubuntu 18 server, getting lamp-server, php7 modules, make a vhost, enable https with certbot, restart apache, unzip nextcloud in /var/www/html/nextcloud
  2. make config in mysql CLI, create database, and user with grant access to this DB.
  3. fill the form accessed from the vhost in https, with strong passwords (i use lastpass)
  4. submit

The output of your Nextcloud log in Admin > Logging:

(cannot access this right now, will upload it when i could)

The output of your config.php file in /path/to/nextcloud (make sure you remove any identifiable information!):

(cannot access this right now)

The output of your Apache/nginx/system log in /var/log/____:

(cannot access this right now)

anbody knows why a correct mysql user could not connect to DB on install ?

usually, you need to created a DB like “nextcloudDB”, and then a DBuser with privileges granted:

notabene: the nextadmin user is my created user with all privileges granted. The oc_nextadmin is created by nextcloud.

During setup install, you need to provide all the info !
Better include also the localhost:3306 ( depending your config )

I have got the same problem with my strato server and msql database.
When I changed my passwords with out any special characters it worked fine. I could finish up the installation wizard für nextcloud 15.02.
May be it could help to know… But what crazy to reduce security

This error is caused by mixing up the username and the database user.
The Admin USERname (on top) is put in the field for the database-user. The database username commes preced with nc_ .
The system is generating a password for the database user, one that is not in any input field.
So Nextcloud has no access to the database with these wrong credentials.

This is on a fresh install of and not solved in most recent

Installation version 17.0.1 gives the same error.

Perhaps one should create a user and password in MySQL that is the same as put in the config.php. Changing it there to the correct values results in an Internal Server error