MariaDB no se inicia después de la instalación

MariaDB no se inicia después de la instalación

Estoy ejecutando un servidor Ubuntu 20.4 y recientemente eliminé mysql-server y mysql-client y estoy intentando que MariaDB esté en funcionamiento. He instalado mariadb-server y mariadb-client. Me detengo y luego intento reiniciar maria db. Recibo el mensaje de error general:

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

Luego corro systenctl status mariadb.servicey obtengo lo siguiente:

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.

Luego ejecuto journalctl -xdy obtengo estos resultados:

-- 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 

Tengo el puerto 3306 completamente abierto en UFW, así que no estoy seguro de por qué aparece el error UFW BLOCK.

Intenté purgar todo lo relacionado con mysql y mariadb y reinstalé mariadb varias veces, pero me encontré con el mismo problema.

Respuesta1

Bien, después de mucho jugar con esto, terminé eliminando/purgando completamente MariaDB y todo en mysql.

Corrí:

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

sudo find / | grep mysqlLuego eliminé los archivos restantes de MySQL.

sudo find / | grep mariadbLuego eliminé los archivos restantes de mariadb.

sudo deluser --remove-home mysql

sudo delgroup mysql

Probablemente esto sea excesivo, pero me estaba frustrando. Después de eliminar todo, volví a mysql e instalé mysql-server. Pude ponerlo en funcionamiento esta vez sin problemas.

CREO que puede haber habido un problema con un enlace simbólico de cuando originalmente tenía mysql en lugar de MariaDB, pero después de simplemente destruirlo y comenzar desde cero pude hacerlo funcionar.

información relacionada