MariaDB failing... help please

  • DietPi version | 8.6.1
  • Device: intel pc
  • Samsung Duo Plus USB 128gb

My MariaDB service isnt starting, i mounted an external hdd and checked the “use for user data” and deleted the original user data folder because i didnt understand why the original one didnt get deleted.
(i just read that the user data folder will always be in /mnt/ even though the user data is stored elsewhere, so i guess i just deleted all my userdata… luckely everything works as far as i now except that MariaDB doesnt start, and cant be deleted)

But now my mariaDB service doesnt start
And when i delete MariaDB trough the UI i get a error because before i remove it because it tries to start MariaDB to make a backup… which is stupid because i cant start it, thats the problem…

When i delete it trough the purge command it still shows up on the services screen and it still fails to start

I ran: journalctl -u mariadb

Jul 30 12:32:37 DietPi systemd[1]: Starting MariaDB 10.3.34 database server...
Jul 30 12:32:38 DietPi mysqld[865]: 2022-07-30 12:32:38 0 [Note] /usr/sbin/mysqld (mysqld 10.3.34-MariaDB-0+deb10u1) starting as process 865 ...
Jul 30 12:32:38 DietPi mysqld[865]: 2022-07-30 12:32:38 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Jul 30 12:32:38 DietPi mysqld[865]: [90B blob data]
Jul 30 12:32:38 DietPi mysqld[865]: 2022-07-30 12:32:38 0 [ERROR] Aborting
Jul 30 12:32:38 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jul 30 12:32:38 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jul 30 12:32:38 DietPi systemd[1]: Failed to start MariaDB 10.3.34 database server.
Jul 30 12:39:50 DietPi systemd[1]: Starting MariaDB 10.3.34 database server...
Jul 30 12:39:51 DietPi mysqld[14465]: 2022-07-30 12:39:51 0 [Note] /usr/sbin/mysqld (mysqld 10.3.34-MariaDB-0+deb10u1) starting as process 14465 ...
Jul 30 12:39:51 DietPi mysqld[14465]: 2022-07-30 12:39:51 0 [Warning] Can't create test file /var/lib/mysql/DietPi.lower-test
Jul 30 12:39:51 DietPi mysqld[14465]: [90B blob data]
Jul 30 12:39:51 DietPi mysqld[14465]: 2022-07-30 12:39:51 0 [ERROR] Aborting
Jul 30 12:39:51 DietPi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Jul 30 12:39:51 DietPi systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jul 30 12:39:51 DietPi systemd[1]: Failed to start MariaDB 10.3.34 database server.

Usually the user data folder on /mnt should have been a symbol link and not a real folder. It is an important link necessary for operation. Removing it will break your system. But something we could recreate.

Can you share ls -la /mnt

drwxrwxrwx  7 root   root   4096 Jul 30 13:17 .
drwxr-xr-x 18 root   root   4096 Jul 30 13:16 ..
drwxr-xr-x  4 root   root   4096 Jul 30 00:47 2TB
lrwxrwxrwx  1 root   root     24 Jul 30 13:17 dietpi_userdata -> /mnt/2TB/dietpi_userdata
drwxrwxr-x  2 dietpi dietpi 4096 Aug  6  2020 ftp_client
drwxrwxr-x  2 dietpi dietpi 4096 Aug  6  2020 nfs_client
drwxrwxr-x  2 dietpi dietpi 4096 Aug  6  2020 samba
drwxrwxrwx  2 root   root   4096 Jul 30 00:42 ssdtemp

When i deleted the userdata folder from /mnt/ i checked the checkbox in disk management, but i didnt see the setting in dietpi-software to change the user data location. But now (after the deletion) i did find that setting as you can see in the code

What in dietpi-software you can’t change anything related to user data directory. This all is done in drive manager.

What exactly you removed? Did you recall? Because user data is linked to your 2TB drive. Can you share content

ls -la /mnt/2TB/dietpi_userdata

As well let’s check following

readlink /var/lib/mysql
readlink -f /var/lib/mysql