NextcloudPi: MariaDB down - can't change path to dbdir

Hi, I have a raspberry pi 4 with a NCP image installed. After I mounted a second USB drive for backup, the path to dbdir seems to be changed. NextcloudPi Panel shows:

“dbdir: /media/USBdrive/ncdatabase (doesn’t exist)”

This path should be /media/myCloudDrive/ncdatabase. If I try to change it via ‘config nc-database’ I get this result:

Screenshot 2020-03-29 at 17.35.18

I followed the steps described in this post: and changed the path to datadir in /etc/mysql/mariadb.conf.d/50-server.cnf to /media/myCloudDrive/ncdatabase.

However, the problem still exists: MariaDB remains down.

I’m running NextcloudPi 1.24.0 and Nextcloud This is what’s inside /media/USBdrive/ncdatabase:

Screenshot 2020-03-29 at 17.48.48

How can I change the path to the database so my Nextcloud will be up and running again?

You will likely need to edit NC’s config file.

sudo nano /var/www/nextcloud/config/config.php

and edit/check value’s of:

‘datadirectory’ =>
‘tempdirectory’ =>
‘logfile’ =>

Hi OliverV, Thanks for your quick reply!

I have checked the config.php and the values are:
‘datadirectory’ => ‘/media/myCloudDrive/ncdata/tmp’
‘tempdirectory’ => ‘/media/myCloudDrive/ncdata/tmp’
‘logfile’ => ‘/media/myCloudDrive/ncdata/nextcloud.log’

This is what’s inside my ‘/media/myCloudDrive’ folder:

Screenshot 2020-03-29 at 20.48.21

My NextcloudPi chrashed in march, so I’ve configured a new NexcloudPi. Is it possible that the new value must be ‘ncdata-03-18-20’?

There is a typo/error in the datadirectory PATH, remove /tmp !
It should be:
‘datadirectory’ => ‘/media/myCloudDrive/ncdata’

ncdata-03-18-20 could be your backup, so no harm in trying it.

Thanks for your help and your really good eye for typos. I’m sorry: I made a typo in the message itself - my config.php has the correct path (without /tmp). I have just checked /etc/mysql/mariadb.conf.d/50-server.cnf and these are the values in that file:

Screenshot 2020-03-30 at 15.36.22

After a reboot MariaDB is still down.

Screenshot 2020-03-30 at 15.42.36

I was expecting that the path for ‘datadir’ in '/etc/mysql/mariadb.conf.d/50-server.cnf ’ would be visible in the NextcloudPi System info, but the ‘dbdir’ still points to ‘/media/USBdrive/ncdatabase’. Could this be the problem? And/or is there another config-file that I should change?

Check nc-database (NCP>>CONFIG)
USBdrive is it’s default example PATH.
Simply run it again using the myCloudDrive instead of USBdrive
and reboot or start the mariadb.service from terminal

I fixed the problem. After I changed the path to the database in etc/mysql/mariadb.conf.d/90-ncp.cnf and a reboot everything is working again.

@OliverV Many thanks for your help. Your suggestions made me repeat all the necessary steps and think a bit further.