Nextcloud breaks MariaDB on Install

I’ve set up my pi webserver to host two personal sites using Lighttpd. I’ve changed my lighttpd.conf to point to my usb drive that has the site files. I’ve set my dietpi_userdata to the USB drive using the dietpi-software drive manager, and edited the fstab to auto mount the USB. All permissions seem to be correct. Webserver and mariaDB (installed as part of the LLMP) were working, that is loading. Then I install Nextcloud using dietpi-software, and install exited with error due to mariaDB not starting.

Here is the systemctl readout:

● mariadb.service - MariaDB 10.1.38 database server
Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Mon 2019-07-08 18:23:31 CDT; 56s ago
Docs: man:mysqld(8)
Process: 7249 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION
(code=exited, status=1/FAILURE)
Process: 7154 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=/usr/bin /galera_recovery; [ $? -eq 0 ] && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1
(code=exited, status=0/SUCCESS)
Process: 7147 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exit
ed, status=0/SUCCESS)
Process: 7142 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exite
d, status=0/SUCCESS)
Main PID: 7249 (code=exited, status=1/FAILURE)
Status: “MariaDB server is down”

Jul 08 18:23:29 web-pi systemd[1]: Starting MariaDB 10.1.38 database server…
Jul 08 18:23:31 web-pi mysqld[7249]: 2019-07-08 18:23:31 1996218160 [Note] /usr/sbin/mysqld (mysqld
10.1.38-MariaDB-0+deb9u1) starting as process 7249 …
Jul 08 18:23:31 web-pi mysqld[7249]: 2019-07-08 18:23:31 1996218160 [Warning] Can’t create test file
Jul 08 18:23:31 web-pi systemd[1]: mariadb.service: Main process exited, code=exited, status
Jul 08 18:23:31 web-pi systemd[1]: Failed to start MariaDB 10.1.38 database server.
Jul 08 18:23:31 web-pi systemd[1]: mariadb.service: Unit entered failed state.
Jul 08 18:23:31 web-pi systemd[1]: mariadb.service: Failed with result ‘exit-code’.

This is my second attempt at this. First time, Nextcloud and the servers worked fine, but data was being stored to the sd card, not the USB, so when I moved the userdata folder mariaDB broke, i.e. failed to load. Thought presetting everything would keep it from breaking, but didn’t work.

Is this the problem? The link is wrong?
lrwxrwxrwx 1 mysql mysql 26 Jul 8 18:21 mysql → /mnt/dietpi_userdata/mysql
I tried creating a new symlink to the USB dietpi_userdata, but when I tried to install Nextcloud again, it failed, again. It seems to only want to link to /mnt/dietpi_userdata/mysql regardless of where you have put your userdata.



Did I understand right, that you try to move the mysql/mariadb data diretory (usually /var/lib/mysql) to your USB drive?

Regards, rasputin