MariaDB startet nach der Installation nicht

MariaDB startet nach der Installation nicht

Ich betreibe einen Ubuntu 20.4-Server und habe vor Kurzem mysql-server und mysql-client entfernt und versuche, MariaDB zum Laufen zu bringen. Ich habe sowohl mariadb-server als auch mariadb-client installiert. Ich halte an und versuche dann, mariadb neu zu starten. Ich erhalte die allgemeine Fehlermeldung:

Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

Ich führe es dann aus systenctl status mariadb.serviceund erhalte Folgendes:

mariadb.service - MariaDB 10.6.4 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
    Drop-In: /etc/systemd/system/mariadb.service.d
             └─migrated-from-my.cnf-settings.conf
     Active: failed (Result: exit-code) since Thu 2021-09-23 13:26:03 CDT; 8s ago
       Docs: man:mariadbd(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 97366 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 97377 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 97379 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   &&>
    Process: 97387 ExecStart=/usr/sbin/mariadbd $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 97387 (code=exited, status=1/FAILURE)

Sep 23 13:26:03 notised.xyz systemd[1]: Starting MariaDB 10.6.4 database server...
Sep 23 13:26:03 notised.xyz sh[97384]: [114B blob data]
Sep 23 13:26:03 notised.xyz sh[97384]: Fatal error in defaults handling. Program aborted
Sep 23 13:26:03 notised.xyz mariadbd[97387]: [106B blob data]
Sep 23 13:26:03 notised.xyz mariadbd[97387]: Fatal error in defaults handling. Program aborted
Sep 23 13:26:03 notised.xyz systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Sep 23 13:26:03 notised.xyz systemd[1]: mariadb.service: Failed with result 'exit-code'.
Sep 23 13:26:03 notised.xyz systemd[1]: Failed to start MariaDB 10.6.4 database server.

Ich führe es dann aus journalctl -xdund erhalte diese Ergebnisse:

-- A start job for unit cloud-final.service has finished successfully.
-- 
-- The job identifier is 153.
Sep 23 14:16:57 notised.xyz systemd[1]: Reached target Cloud-init target.
-- Subject: A start job for unit cloud-init.target has finished successfully
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- A start job for unit cloud-init.target has finished successfully.
-- 
-- The job identifier is 148.
Sep 23 14:16:57 notised.xyz systemd[1]: Startup finished in 6.792s (kernel) + 2min 3.586s (userspace) = 2min 10.379s.
-- Subject: System start-up is now complete
-- Defined-By: systemd
-- Support: http://www.ubuntu.com/support
-- 
-- All system services necessary queued for starting at boot have been
-- started. Note that this does not mean that the machine is now idle as services
-- might still be busy with completing start-up.
-- 
-- Kernel start-up required 6792915 microseconds.
-- 
-- Initial RAM disk start-up required INITRD_USEC microseconds.
-- 
-- Userspace start-up required 123586997 microseconds.
Sep 23 14:17:01 notised.xyz CRON[2544]: pam_unix(cron:session): session opened for user root by (uid=0)
Sep 23 14:17:01 notised.xyz CRON[2552]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Sep 23 14:17:01 notised.xyz CRON[2544]: pam_unix(cron:session): session closed for user root
Sep 23 14:17:10 notised.xyz kernel: [UFW BLOCK] IN=eno1 OUT= MAC=90:2b:34:56:57:f0:74:ac:b9:eb:12:94:08:00 SRC=192.168.1.16 DST=192.168.1.62 LEN=222 TOS=0x00 PREC=0x00 TTL=64 ID=0 DF PROTO=UDP SPT=57572 DPT=5514 LEN=202 

Ich habe Port 3306 auf UFW vollständig geöffnet und bin mir daher nicht ganz sicher, warum der UFW-BLOCK-Fehler angezeigt wird.

Ich habe versucht, alles zu löschen, was mit MySQL und MariaDB zu tun hat, und MariaDB mehrmals neu installiert, bin aber auf das gleiche Problem gestoßen.

Antwort1

OK, nachdem ich also viel herumprobiert hatte, habe ich MariaDB und alles schließlich vollständig entfernt/bereinigt und nach MySQL verschoben.

Ich bin gelaufen:

sudo apt purge mariadb* *mariadb mysql* *mysql
sudo apt autoremove
sudo apt update && sudo apt full-upgrade -y

sudo find / | grep mysqlIch habe dann alle verbleibenden Dateien für MySQL entfernt

sudo find / | grep mariadbIch habe dann alle verbleibenden Dateien für MariaDB entfernt

sudo deluser --remove-home mysql

sudo delgroup mysql

Das ist wahrscheinlich übertrieben, aber ich war frustriert. Nachdem ich alles entfernt hatte, ging ich einfach zurück zu MySQL und installierte den MySQL-Server. Diesmal konnte ich es ohne Probleme zum Laufen bringen.

Ich glaube, es gab möglicherweise ein Problem mit einem symbolischen Link, weil ich ursprünglich MySQL statt MariaDB hatte, aber nachdem ich es einfach gelöscht und von vorne begonnen hatte, konnte ich es zum Laufen bringen.

verwandte Informationen