Mysqladmin: connect to server at 'localhost' failed

Nextcloud version : 12.0.4
Operating system : Ubuntu 16.04.3 LTS
Apache : 2.4.18
PHP version : 7.0.22

The issue you are facing:

Everyday at 06:25 am i get a mail telling mysqladmin: connect to server at ‘localhost’ failed
See content at the end of my posting
First of all i am new to Nextcloud and using ubuntu in general. I used the official documentation to set things up.
I did some investigation and found out that usually the user debian-sys-maint should be the user for this job, but somehow in my case it’s root.

this is my debian.cnf

Mailcontent:

cat /etc/mysql/debian.cnf
# Automatically generated for Debian scripts. DO NOT TOUCH!
[client]
host     = localhost
user     = root
password =
socket   = /var/run/mysqld/mysqld.sock
[mysql_upgrade]
host     = localhost
user     = root
password =
socket   = /var/run/mysqld/mysqld.sock
basedir  = /usr

There is no password in the .cnf
i tried to set the password for mysql root but i still get the mails every morning.
How can i fix this as i dont think these errors should appear in my system?
I did not upgrade from another System, this was a fresh install.

Is this the first time you’ve seen this error?:

Every day Mail since i set up Nextcloud

Steps to replicate it:

  1. Wait one day
  2. Get new Mail

The output of your Nextcloud log in Admin > Logging:

No Error logs for the time 6:25 when i receive the mails

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

$CONFIG = array (
  'instanceid' => ,
  'passwordsalt' => '',
  'secret' => '',
  'trusted_domains' =>
  array (
    0 => '',
  ),
  'datadirectory' => '',
  'overwrite.cli.url' => '',
  'dbtype' => 'mysql',
  'version' => '12.0.4.3',
  'dbname' => '',
  'dbhost' => 'localhost',
  'dbport' => '',
  'dbtableprefix' => 'oc_',
  'dbuser' => '',
  'dbpassword' => '',
  'installed' => true,
  'mail_smtpmode' => '',
  'mail_smtpauthtype' => '',
  'mail_from_address' => '',
  'mail_domain' => '',
  'memcache.local' => '\\OC\\Memcache\\APCu',
  'maintenance' => false,
  'loglevel' => 0,
  'mail_smtpauth' => ,
  'mail_smtphost' => '',
  'mail_smtpport' => '',
  'mail_smtpname' => '',
  'mail_smtppassword' => '',
  'mail_smtpsecure' => '',
);

Mailcontent:

Return-Path: <root@cloud>
X-Original-To: root
Delivered-To: root@cloud
Received: by cloud (Postfix, from userid 0)
        id 447857F9B5; Thu, 11 Jan 2018 06:25:11 +0100 (CET)
From: root@cloud (Cron Daemon)
To: root@cloud
Subject: Cron <root@cloud> test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
X-Cron-Env: <SHELL=/bin/sh>
X-Cron-Env: <PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin>
X-Cron-Env: <HOME=/root>
X-Cron-Env: <LOGNAME=root>
Message-Id: <20180111052511.447857F9B5@cloud>
Date: Thu, 11 Jan 2018 06:25:11 +0100 (CET)
X-IMAPbase: 1515660686 12
Status: O
X-UID: 6

/etc/cron.daily/logrotate:
mysqladmin: connect to server at 'localhost' failed
error: 'Access denied for user 'root'@'localhost' (using password: NO)'
error: error running shared postrotate script for '/var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/mariadb-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

I use the debian-sys-maint and root (isn’t that the default setting). The debian-sys-maint has normally a long and complicated password, if you don’t know it anymore, you can create a new one: https://serverfault.com/questions/9948/what-is-the-debian-sys-maint-mysql-user-and-more#9952

The general problem i am facing here is that the debian-sys-maint user which should be the standard user for these task doesnt even exist in my mysql userlist. When i log on to my mysql server (Mariadb) and run select * from mysql.user i get 3 accounts: root and 2 times “userxyz” (yes 2 times the same account).
I think there is a general problem with my nextcloud configuration.
I have seen other nextcloud/mariaDB configs and everytime the user debian-sys-maint is the standard user.
Does it have to do something with the fact that i am running ubuntu from a fresh install?

Still getting these mails daily, anyone got a solution for me?
I created the debian-sys-maint user for those tasks, configured the debian.cnf file but still no changes :confused:
i am pretty worried as we want to use it soon and i dont know if this error may have critical effects on my data in the future. I am using the cloud on my own right now for testing purposes and i dont recognize any abnormalities till now.
Would appreciate some advices for this