Learning and Sharing
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
  • Home
  • Blog
  • Linux
  • macOS
  • Virtualization
    • VMware
    • VirtualBox
  • Windows
    • Windows 11
    • Windows 10
    • Windows Server
  • Series
    • Symantec
    • Intune
    • Microsoft Azure
    • Powershell
    • VirtualBox
    • VMware
    • PowerShell Learning
    • Microsoft Graph
  • More
    • Auto Installation
    • AEC Installation
  • Contact
No Result
View All Result
No Result
View All Result

mariadb.service Failed Because the Control Process Exited with Error Code

November 24, 2022
in Blog, Linux
0
ADVERTISEMENT

Table of Contents

Problem

Yesterday, when I start the MariaDB on my server, I got the error below:

bonben@ub20:# systemctl start mariadb.service
Job for mariadb.service failed because the control process exited with error code.
See "systemctl status mariadb.service" and "journalctl -xe" for details.

The output when I ran the command systemctl status mariadb.service:

bonben@ub20:# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.34 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: failed (Result: exit-code) since Thu 2022-11-24 08:25:40 UTC; 10min ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 2071 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 2072 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 2074 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   
    && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 2121 ExecStart=/usr/sbin/mysqld $MYSQLD_OPTS $_WSREP_NEW_CLUSTER $_WSREP_START_POSITION (code=exited, status=1/FAILURE)
   Main PID: 2121 (code=exited, status=1/FAILURE)
     Status: "MariaDB server is down"

Nov 24 08:25:38 store systemd[1]: Starting MariaDB 10.3.34 database server...
Nov 24 08:25:38 store mysqld[2121]: 2022-11-24  8:25:38 0 [Note] /usr/sbin/mysqld (mysqld 10.3.34-MariaDB-0ubuntu0.20.04.1) starting as process 2121 ...
Nov 24 08:25:40 store systemd[1]: mariadb.service: Main process exited, code=exited, status=1/FAILURE
Nov 24 08:25:40 store systemd[1]: mariadb.service: Failed with result 'exit-code'.
Nov 24 08:25:40 store systemd[1]: Failed to start MariaDB 10.3.34 database server.

Solution

The solution is deleting or renaming the tc.log file, this file is created automatically when the MariaDB server crashed.

You can use mlocate to find that file as follows. And as you can see, the file located in /var/lib/mysql.

bonben@ub20:# mlocate tc.log
/var/lib/mysql/tc.log

Now, remove or delete that file using following command:

###Remove the file
sudo rm /var/lib/mysql/tc.log

###Rename that file
sudo mv /var/lib/mysql/tc.log /var/lib/mysql/tc.log.old

Finally, restart the MariaDB service:

bonben@ub20:# systemctl start mariadb.service
bonben@ub20:# systemctl status mariadb.service
● mariadb.service - MariaDB 10.3.34 database server
     Loaded: loaded (/lib/systemd/system/mariadb.service; enabled; vendor preset: enabled)
     Active: active (running) since Thu 2022-11-24 08:37:17 UTC; 5s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 3322 ExecStartPre=/usr/bin/install -m 755 -o mysql -g root -d /var/run/mysqld (code=exited, status=0/SUCCESS)
    Process: 3323 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 3325 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bin/..; /usr/bin/galera_recovery`; [ $? -eq 0 ]   && systemctl set-environment _WSREP_START_POSITION=$VAR || exit 1 (code=exited, status=0/SUCCESS)
    Process: 3403 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 3405 ExecStartPost=/etc/mysql/debian-start (code=exited, status=0/SUCCESS)
   Main PID: 3372 (mysqld)
     Status: "Taking your SQL requests now..."
      Tasks: 32 (limit: 9530)
     Memory: 138.0M
     CGroup: /system.slice/mariadb.service
             └─3372 /usr/sbin/mysqld

Nov 24 08:37:17 store mysqld[3372]: 2022-11-24  8:37:17 0 [Note] /usr/sbin/mysqld (mysqld 10.3.34-MariaDB-0ubuntu0.20.04.1) starting as process 3372 ...
Nov 24 08:37:17 store systemd[1]: Started MariaDB 10.3.34 database server.
Nov 24 08:37:17 store /etc/mysql/debian-start[3407]: Upgrading MySQL tables if necessary.
Nov 24 08:37:17 store /etc/mysql/debian-start[3410]: Looking for 'mysql' as: /usr/bin/mysql
Nov 24 08:37:17 store /etc/mysql/debian-start[3410]: Looking for 'mysqlcheck' as: /usr/bin/mysqlcheck
Nov 24 08:37:17 store /etc/mysql/debian-start[3410]: This installation of MariaDB is already upgraded to 10.3.34-MariaDB.
Nov 24 08:37:17 store /etc/mysql/debian-start[3410]: There is no need to run mysql_upgrade again for 10.3.34-MariaDB.
Nov 24 08:37:17 store /etc/mysql/debian-start[3410]: You can use --force if you still want to run mysql_upgrade
Nov 24 08:37:17 store /etc/mysql/debian-start[3418]: Checking for insecure root accounts.
Nov 24 08:37:17 store /etc/mysql/debian-start[3422]: Triggering myisam-recover for all MyISAM tables and aria-recover for all Aria tables
5/5 - (1 vote)
Previous Post

How to Dual Boot macOS Monterey and macOS Ventura on Your Mac

Next Post

How to Enable Auto Login in macOS

Related Posts

Running Hyper-V and VMware Workstation on The Same Machine

August 15, 2024

How to Uninstall All Autodesk Products At Once Silently

July 29, 2024
Ftr5

How to Uninstall the Autodesk Genuine Service on Windows

July 29, 2024
Ftr19

How to Fix Windows Cannot Read the ProductKey From the Unattend Answer File in VirtualBox

July 26, 2024
Ftr25

How to Update Windows Terminal in Windows 10/11

July 26, 2024

How to Disable The Beep Sound in WSL Terminal on Windows

July 26, 2024

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Recent Posts

  • How To Turn On uBlock Origin Extension in Chrome (2025)
  • Images Hidden Due To Mature Content Settings In CivitAI
  • Azure OpenAI vs Azure AI Hub, How to Choose the Right One for Your Needs

Categories

Stay in Touch

Discord Server

Join the Discord server with the site members for all questions and discussions.

Telegram Community

Jump in Telegram server. Ask questions and discuss everything with the site members.

Youtube Channel

Watch more videos, learning and sharing with Leo ❤❤❤. Sharing to be better.

Newsletter

Join the movement and receive our weekly Tech related newsletter. It’s Free.

General

Microsoft Windows

Microsoft Office

VMware

VirtualBox

Technology

PowerShell

Microsoft 365

Microsoft Teams

Email Servers

Copyright 2025 © All rights Reserved. Design by Leo with ❤

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory

No Result
View All Result
  • Home
  • Linux
  • Intune
  • macOS
  • VMware
  • VirtualBox
  • Powershell
  • Windows 10
  • Windows 11
  • Microsoft 365
  • Microsoft Azure
  • Microsoft Office
  • Active Directory