# Nextcloud breaks MariaDB on Install

**URL:** https://dietpi.com/forum/t/nextcloud-breaks-mariadb-on-install/3329
**Category:** Troubleshooting
**Created:** [9 July 2019 02:20 UTC](https://dietpi.com/forum/t/nextcloud-breaks-mariadb-on-install/3329 "2019-07-09T02:20:37Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![tenorable](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/t/9fc348/32.png) [@tenorable](https://dietpi.com/forum/u/tenorable)
#### Post date: [9 July 2019 02:20 UTC](https://dietpi.com/forum/t/nextcloud-breaks-mariadb-on-install/3329/1 "2019-07-09T02:20:37Z")

</div>

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)  
[https://mariadb.com/kb/en/library/systemd/](https://mariadb.com/kb/en/library/systemd/)  
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  
/var/lib/mysql/web-pi.lower-test  
Jul 08 18:23:31 web-pi systemd[1]: mariadb.service: Main process exited, code=exited, status  
=1/FAILURE  
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.

Help…

---

<div class="post-metadata">

### Author: ![rasputin](https://dietpi.com/forum/letter_avatar_proxy/v4/letter/r/dec6dc/32.png) [@rasputin](https://dietpi.com/forum/u/rasputin)
#### Post date: [20 July 2019 13:56 UTC](https://dietpi.com/forum/t/nextcloud-breaks-mariadb-on-install/3329/2 "2019-07-20T13:56:00Z")

</div>

tenorable

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

Regards, rasputin
