both mariadbd and mysqld running

turbo2ltr

Verified User
Joined
Nov 29, 2021
Messages
21
I was trying to reset the root mysql password. I started poking around and i stopped mysqld service. But I found a copy of mariadb also running.

Code:
root [~] # ps -aux | grep mysql*
mysql     502665  0.0  5.7 1088348 102488 pts/1  Sl   08:22   0:00 /usr/local/bin/mariadbd --basedir=/usr/local --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plu-user=mysql --skip-grant-tables --log-error=/usr/local/mysql/data/phx.err --pid-file=phx.pid
root      509187  0.0  0.1   4656  3456 ?        S    08:31   0:00 sh -c /usr/bin/systemctl start mysqld.service        >/dev/null 2>/dev/null
root      509188  0.0  0.4  19864  8576 ?        S    08:31   0:00 /usr/bin/systemctl start mysqld.service
root      509576  0.0  0.1   4656  3456 ?        S    08:31   0:00 sh -c /usr/bin/systemctl restart mysqld.service 2>&1
root      509577  0.0  0.4  19864  8448 ?        S    08:31   0:00 /usr/bin/systemctl restart mysqld.service
mysql     509618  0.2  2.5 244204 45352 ?        Ssl  08:31   0:00 /usr/local/mysql/bin/mysqld --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock
root      509814  0.0  0.1   3876  2048 pts/1    S+   08:32   0:00 grep --color=auto mysql*


root [~] # systemctl stop mysqld
root [~] # systemctl stop mariadbd
 Failed to stop mariadbd.service: Unit mariadbd.service not loaded.
root [~] # systemctl stop mariadb
 Failed to stop mariadb.service: Unit mariadb.service not loaded.
root [~] # ps -aux | grep mysql*
mysql     502665  0.0  5.7 1088348 102488 pts/1  Sl   08:22   0:00 /usr/local/bin/mariadbd --basedir=/usr/local --datadir=/usr/local/mysql/data --plugin-dir=/usr/local/mysql/lib/plugin --user=mysql --skip-grant-tables --log-error=/usr/local/mysql/data/phx.err --pid-file=phx.pid

Is this normal to have both mysql and mariadb running? I quite sure it's not.
In the current state as above, mysql won't connect. no socket.
When I try to start mysqld.

Code:
root [~] # systemctl start mysqld
Job for mysqld.service failed because the control process exited with error code.
See "systemctl status mysqld.service" and "journalctl -xeu mysqld.service" for details.

 root [~] # systemctl status mysqld.service
● mysqld.service - MySQL database server
     Loaded: loaded (/etc/systemd/system/mysqld.service; enabled; preset: disabled)
     Active: activating (start) since Sat 2025-07-05 08:43:27 MST; 6s ago
    Process: 518658 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited, status=0/SUCCESS)
    Process: 518659 ExecStartPre=/bin/sh -c [ ! -e /usr/local/mysql/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/local/mysql/bin/..; /usr/local/mysql/bin/galera_recovery`; [ $? >
   Main PID: 518679 (mysqld)
      Tasks: 2 (limit: 10688)
     Memory: 27.7M
        CPU: 112ms
     CGroup: /system.slice/mysqld.service
             └─518679 /usr/local/mysql/bin/mysqld --datadir=/var/lib/mysql --socket=/var/lib/mysql/mysql.sock

Jul 05 08:48:02 phx systemd[1]: Starting MySQL database server...
Jul 05 08:48:03 phx mysqld[522227]: 2025-07-05  8:48:03 0 [Note] Starting MariaDB 10.6.22-MariaDB source revision 19644f6821d59ecca0f9b1f44fadb3b887061965 server_uid QMIhRG7z0PSeE/47JCJ4HHDd00k= as process 522227
Jul 05 08:48:03 phx mysqld[522227]: 2025-07-05  8:48:03 0 [ERROR] mysqld: Can't lock aria control file '/var/lib/mysql/aria_log_control' for exclusive use, error: 11. Will retry for 30 seconds

This is a fairly fresh DA install.
 
I killed everything and started mysqld service and it seems to be working. It does seem like there are two versions. one at /usr/local/myql and one at /var/lib/mysql.
 
It does seem like there are two versions. one at /usr/local/myql and one at /var/lib/mysql.
That seems normal. I've also got that, but in /usr/local/mysql is the Mariadb installation and in /var/lib/mysql are all the databases and some other stuff. They go together.

If all is well, you will see that the /usr/local/mysql/data directory is a symlink to the /var/lilb/mysql directory so that is correct.

However I don't know if something went wrong. Because by default MariaDB is installed and you can start or restart MariaDB either via the mariadb or mysqld command.
So I don't quite understand where the errors are coming from.

I've seen something similar though on Debian (and deratives). Which OS are you running?

Anyway, unfortunately I'm not a mysql guru.
But if after a reboot multiple Mysql/Mariadb instances are running I would suggest to contact ticket support if you have a modern license.
Unless somebody here knows how to fix this.
Maybe @Zhenyapan or @zEitEr
 
it also possible when you stopped it from console - "DA service monitor" started it again. Thats why better to stop from DA
 
There is nothing wrong when MariaDB server is installed on CentOS/AlmaLinux from sources:

Bash:
[root@server ~]# ls -la /usr/local/bin/mariadbd
lrwxrwxrwx 1 root root 29 Feb 19  2024 /usr/local/bin/mariadbd -> /usr/local/mysql/bin/mariadbd
[root@server ~]# ls -la /usr/local/bin/mysql
lrwxrwxrwx 1 root root 26 Feb 19  2024 /usr/local/bin/mysql -> /usr/local/mysql/bin/mysql
[root@server ~]#

but there is no need to use the both mariadb.service and mysqld.service, you should stick to only one service:

Bash:
[root@server ~]# ls -la /etc/systemd/system/mysqld.service /etc/systemd/system/mariadb.service
-rw-r--r-- 1 root root 4206 Dec 30  2023 /etc/systemd/system/mariadb.service
-rw-r--r-- 1 root root 5927 Jun  5 10:28 /etc/systemd/system/mysqld.service
[root@server ~]#
 
but there is no need to use the both mariadb.service and mysqld.service, you should stick to only one service:
Correct. However DA is making this a bit confusing now, since nowadays there is no mariadb.service anymore, even when running mariadb the mysqld.service is used.
Code:
ls -la /etc/systemd/system/mysqld.service /etc/systemd/system/mariadb.service
ls: cannot access '/etc/systemd/system/mariadb.service': No such file or directory
-rw-r--r-- 1 root root 5927 May 25 01:16 /etc/systemd/system/mysqld.service

That is why I thought something went wrong here and asked for the OS. I had something like this on Debian once, and it appeared one of the mariadb-common or mysql-common (if I remember correctly) packages was installed when installing "mytop", again if my memory is correct.
And then I also had 2 services suddenly.
Maybe something similar happened here. Because it's odd that there are 2 services, just like you say.
 
Back
Top