MariaDB refuse me :( SQLSTATE[HY000] [1044] Access denied for user 'oc_Sylvain'@'%' to database 'nextcloud'

Hi all,

I have a strange problem when I try installing Nextcloud 13 on my VM

Well, I dont speak fluently your language, I try to explain you better than I can…

  1. I create a VM With ubuntu 18.04 and only MariaDB (latest stable version) (VM1 and ip = 192.168.vm1…)
    I’ll create one user for each Vm needed with all privileges on databases from his VM and IP of this VM

  2. I use mysql_secure_installation

  3. I create another VM (VM2) with ubuntu 18.04 and nginx, php 7.2 and I installed an application using php and mariadb
    ==> This VM can use internet connexion and have an https dommaine
    ==> It’s working fine

  4. I create new VM (VM3) with ubunto 18.04 and ngnx and php7.2 and I installed Nextcloud 13
    => I follow all indication and I have an https domaine
    => First page to install is on my screen…

    => On MariaDB VM, I create a user for Nextcloud database with all provileges on ‘nextcloud’ database

When I type select user,host from mysql.user; I have just

  • ‘root’@‘locahost’

On form I type :
Admin Nextcloud => Sylvain (me :slight_smile:)
Password => my password

User database => NC_user
Password => NC_user Password
Database => nextcloud
Host : (Ip of mariaDB VM)

  1. After all this operation I have :
    Error while trying to create admin user: Failed to connect to the database: An exception occured in driver: SQLSTATE[HY000] [1044] Access denied for user ‘oc_Sylvain’@’%’ to database 'nextcloud’

First question : Why Nextcloud create user ‘oc_Sylvain’@‘localhost’ and oc_Sylvain’@’%’ on mariaDB ?

Second question : How to forced Nextcloud to use NC_user ?

Thanks very much for reading all this.


PS : I looked for all post this Access denied, but don’t find for my problem

This way nextcloud tests if this is an admin user and then creates a user with only permissions to the Nextcloud database.

There have been a couple of problems that it didn’t work all the time. Did you try the installation via the occ command? There you can give all parameters and mostly it worked more reliable.


The procedure I use :slight_smile:

I download latest stable version of nextcloud. I unzip it on /vat/www/html/nextcloud directory ;

I create à nextcloud.conf for Nginx with your model

I have an domain name with https that pointe to nextcloud

All file and directory are www-data:www-data (I have an error like some application if this is root:root

I create mariaDB user and ‘nextcloud’ database. This user have all permission on nextcloud database

Well I anderstand nextcloud do some verification, but for the security, I do not want that nextcloud have permission on all database. juste “nextcloud”

EDIT : I find what is occ command => I use that and nextcloud create sqlit3 database…
I use occ command to converte on mariaDB data base

My OS is ubuntu 18.04 MATE

Thanks for help

Nextcloud work well :slight_smile:

This is resolve…