programing

Cant start mariadb after switching Data Directory

newsource 2023. 8. 8. 21:40

Cant start mariadb after switching Data Directory

Im trying to switch the data directory of mariadb to my HDD drive. But if i change datadir variable in the 50-server.cnf, mariadb wont start.

I have already modified the new directory with chmod and chown.

After switching the directory i get this message:

pi@raspberrypi:/etc/mysql/mariadb.conf.d $ sudo systemctl restart mariadb Job for mariadb.service failed because the control process exited with error >code. See "systemctl status mariadb.service" and "journalctl -xe" for details.

This is the Error:

● mariadb.service - MariaDB 10.1.38 database server Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Sat 2019-08-10 13:10:25 CEST; 3min 26s ago Docs: man:mysqld(8) https://mariadb.com/kb/en/library/systemd/ Process: 5386 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE) Process: 5309 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= || VAR=/usr/bin/galera_recovery; [ $? -eq 0 ] && Process: 5305 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS) Process: 5302 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS) Main PID: 5386 (code=exited, status=1/FAILURE) Status: "Starting Innodb crash recovery"

Aug 10 13:10:20 raspberrypi systemd[1]: Starting MariaDB 10.1.38 database server... Aug 10 13:10:22 raspberrypi mysqld[5386]: 2019-08-10 13:10:22 1996119856 >[Note] /usr/sbin/mysqld (mysqld 10.1.38-MariaDB-0+deb9u1) starti Aug 10 13:10:25 raspberrypi systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE Aug 10 13:10:25 raspberrypi systemd[1]: Failed to start MariaDB 10.1.38 database server. Aug 10 13:10:25 raspberrypi systemd[1]: mariadb.service: Unit entered failed state. Aug 10 13:10:25 raspberrypi systemd[1]: mariadb.service: Failed with result 'exit-code'.

ReferenceURL : https://stackoverflow.com/questions/57441984/cant-start-mariadb-after-switching-data-directory