Score:0

MariaDB Won't Start After Installing

mx flag

I'm running an Ubuntu 20.4 server and I've recently removed mysql-server and mysql-client and am trying to get MariaDB up and running. I've installed both mariadb-server and mariadb-client. I stop and then try to restart maria db. I get the general error message:

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

I then run systenctl status mariadb.service and get the below:

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.

I then run journalctl -xd and get these results:

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

I have port 3306 fully open on UFW, so not quite sure why there is the UFW BLOCK error showing.

I've tried purging everything related to mysql and mariadb and reinstalled mariadb multiple times, but run into the same issue.

in flag
This can happen if MySQL server was not completely removed. Can you [edit] your question to include the steps you followed to uninstall MySQL Server? This will make it easier to know where to start looking for issues
David avatar
cn flag
There is no such Ubuntu version as 20.4. What is the REAL version.
ai flag
You question doesn't specifically state your goal. Did you actually want to start MySQL or MariaDB? It seems like the latter but your answer below suggests you actually wanted to start MySQL so it's not really a solution to the question. Can you try to focus your question on one specific problem and then, if you post an answer, on the solution to that specific problem? Thanks.
Score:2
mx flag

OK, so after a lot of messing around with this I ended up completely removing/purging MariaDB and everything to mysql.

I ran:

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

sudo find / | grep mysql I then removed any remaining files for mysql

sudo find / | grep mariadb I then removed any remaining files for mariadb

sudo deluser --remove-home mysql

sudo delgroup mysql

This is probably overkill, but I was getting frustrated with this. After removing everything I just went back to mysql and installed mysql-server. Was able to get it up and running this time with no issues.

I THINK there may have been an issue with a symlink from when I originally had mysql instead of MariaDB, but after just nuking it and starting over from scratch I was able to get it working.

ai flag
Welcome! Your answer isn't really an answer to your question which ostensibly was how to start MariaDB. Purging both and reinstalling MySQL isn't a solution to that but a solution to the problem of starting MySQL. For the question and answer to be useful to the community your question should state explicitly what you wanted to achieve (either starting MariaDB or MySQL) and your answer should state explicitly how you achieved a solution to the problem you stated in your question. This answer currently is more suited to a comment under the question briefly mentioning that you went back to MySQL.
ru flag
@authentictech *actually*, technically it *is* a solution if you have MySQL and MariaDB data still around, it can clobber and break each other. Also consider this individual is also the OP, and this 'solved' the problem for them - we might just choose instead to close the post as "no longer relevant" as it might not help future readers, but that's a close voter review decision, not a moderator's decision.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.