Shifted usrdata to new hdd now mariadb won´t start

Hi,

ich shifted my userdata to a new external drive with the drive manager.
Now I cant open baikal, nextcloud and can not enter to phpmyadmin.

I tried to restart mariadb with the following result:

root@hermes:~# systemctl restart mariadb
Job for mariadb.service failed because the control process exited with error cod                                             e.
See "systemctl status mariadb.service" and "journalctl -xe" for details.
root@hermes:~# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.18 database server
   Loaded: loaded (/lib/systemd/system/mariadb.service; disabled; vendor preset:
 enabled)
   Active: failed (Result: exit-code) since Sat 2020-01-25 15:07:32 C
ET; 13s ago
     Docs: man:mysqld(8)
           https://mariadb.com/kb/en/library/systemd/
  Process: 981 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run
/mysqld (code=exited, status=0/SUCCESS)
  Process: 982 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_
POSITION (code=exited, status=0/SUCCESS)
  Process: 984 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR=
 ||   VAR=`/usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environmen
t _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
  Process: 1041 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WS
REP_START_POSITION (code=exited, status=1/FAILURE)
 Main PID: 1041 (code=exited, status=1/FAILURE)
   Status: "MariaDB server is down"

Jan 25 15:07:30 hermes systemd[1]: Starting MariaDB 10.3.18 database server...
Jan 25 15:07:30 hermes mysqld[1041]: 2020-01-25 15:07:30 0 [Note] /usr/sbin/mysq
ld (mysqld 10.3.18-MariaDB-0+deb10u1) starting as process 1041 ...
Jan 25 15:07:32 hermes systemd[1]: mariadb.service: Main
 process exited, code=exited, status=1/FAILURE
Jan 25 15:07:32 hermes systemd[1]: mariadb.service: Failed with result 'exit-code'.
Jan 25 15:07:32 hermes systemd[1]: Failed to start MariaDB 10.3.18 database server.

Can you help me to fix this issue. The newest dietpi is installed on a native PC.
Baikal returns me: Baïkal was not able to establish a connexion to the configured MySQL database (as configured in Specific/config.system.php).
And phpmyadmin shows: “Cannot log in to the MySQL server” and “mysqli::real_connect(): (HY000/2002): No such file or directory”


Thank you for your help and instructions

Greetings Elluminatus

Hi,

your problem is the failed MariaDB. Therefore baikal, nextcloud and phpmyadmin are not able to connect. So let’s check what is wrong with the database.

please paste:
journalctl -u mariadb
cat /var/log/mysql/error.log

If it’s empty (hourly RAMlog clear), please restart the service to trigger fresh entries:
systemctl restart mariadb

Hi, thank you for your ultra fast reply!

Here is journalctl -u mariadb

root@hermes:~# journalctl -u mariadb
-- Logs begin at Sat 2020-01-25 15:04:19 CET, end at Sat 2020-01-25 16:04:00 CET
. --
Jan 25 15:04:37 hermes systemd[1]: Starting MariaDB 10.3.18 database server...
Jan 25 15:04:38 hermes mysqld[830]: 2020-01-25 15:04:38 0 [Note] /usr/sbin/mysql
d (mysqld 10.3.18-MariaDB-0+deb10u1) starting as process 830 ...
Jan 25 15:04:41 hermes systemd[1]: mariadb.service: Main
 process exited, code=exited, status=1/FAILURE
Jan 25 15:04:41 hermes systemd[1]: mariadb.service: Fail
ed with result 'exit-code'.
Jan 25 15:04:41 hermes systemd[1]: Failed to start Maria
DB 10.3.18 database server.
Jan 25 15:07:30 hermes systemd[1]: Starting MariaDB 10.3.18 database server...
Jan 25 15:07:30 hermes mysqld[1041]: 2020-01-25 15:07:30 0 [Note] /usr/sbin/mysq
ld (mysqld 10.3.18-MariaDB-0+deb10u1) starting as process 1041 ...
Jan 25 15:07:32 hermes systemd[1]: mariadb.service: Main
 process exited, code=exited, status=1/FAILURE
Jan 25 15:07:32 hermes systemd[1]: mariadb.service: Fail
ed with result 'exit-code'.
Jan 25 15:07:32 hermes systemd[1]: Failed to start Maria
DB 10.3.18 database server.

and “cat /var/log/mysql/error.log”

2020-01-25 16:06:34 0 [Note] InnoDB: Using Linux native AIO
2020-01-25 16:06:34 0 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2020-01-25 16:06:34 0 [Note] InnoDB: Uses event mutexes
2020-01-25 16:06:34 0 [Note] InnoDB: Compressed tables use zlib 1.2.11
2020-01-25 16:06:34 0 [Note] InnoDB: Number of pools: 1
2020-01-25 16:06:34 0 [Note] InnoDB: Using SSE2 crc32 instructions
2020-01-25 16:06:34 0 [Note] InnoDB: Initializing buffer pool, total size = 128M, instances = 1, chunk size = 128M
2020-01-25 16:06:34 0 [Note] InnoDB: Completed initialization of buffer pool
2020-01-25 16:06:34 0 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be $
2020-01-25 16:06:39 0 [Note] InnoDB: 128 out of 128 rollback segments are active.
2020-01-25 16:06:39 0 [Note] InnoDB: Creating shared tablespace for temporary tables
2020-01-25 16:06:39 0 [Note] InnoDB: Setting file './ibtmp1' size to 12 MB. Physically writing the file full; Please $
2020-01-25 16:06:39 0 [Note] InnoDB: File './ibtmp1' size is now 12 MB.
2020-01-25 16:06:39 0 [Note] InnoDB: Waiting for purge to start
2020-01-25 16:06:39 0 [Note] InnoDB: 10.3.18 started; log sequence number 31141841; transaction id 48128
2020-01-25 16:06:39 0 [Note] InnoDB: Loading buffer pool(s) from /mnt/8dd2bd4c-3e55-45c4-8084-888fd1c2f2ad/dietpi_use$
2020-01-25 16:06:39 0 [Note] Plugin 'FEEDBACK' is disabled.
2020-01-25 16:06:39 0 [Note] InnoDB: Buffer pool(s) load completed at 200125 16:06:39
2020-01-25 16:06:39 0 [ERROR] Can't init tc log
2020-01-25 16:06:39 0 [ERROR] Aborting

Greetings Elluminatus (Thank you for the hint with the error log!)

Hi,
can you check if you have a file called /var/lib/mysql/tc.log ?? It seems MariaDB has issues to create this file. Could be file system permissions missing or a stuck log file. If you have such a file, you could try to move it.

mv /var/lib/mysql/tc.log /var/lib/mysql/tc_bkp.log

Hey perfect match! Thank you very much. Baikal is runing now. Nextcloud says it is in “Maintenance Mode”

Now a second problem showed up. Because of the shifting of the userdata I lost my
calendar data from baikal on my iphone.
Thats not the problem: i made a backup from my iphone and filled it from the iphone side.
But in this backup i forgotten that my google authentificator wasn´t part of the backup.

So now phpmyadmin want the 2 way authentification code to go to the backend. But I need to go to the backend first to establish
a connection for the 2 way authentification…

Strange situation… can you help? I found this hint, but I dont know what to enter where:

You can reset the U2F by deleting the row or the data in the phpmyadmin table phpmyadmin.pma__userconfig

DELETE FROM phpmyadmin.pma__userconfig WHERE username=‘root’;

Greetings and many thanks!

Elluminatus

Answer myself. Found it. Simple enter “mysql” at the command line ans copy and paste the command above with the right user.

Thank you for helping me!

Greetings Elluminatus

Regarding NextCloud: Maintenance Mode can be switched off as follow

ncc maintenance:mode --off