Preamble, I've done some research and as usual we have a cornucopia of similar questions but not exactly covering the described title:
- https://askubuntu.com/questions/1407756/akonadi-on-kde-cant-start-due-to-unknown-error-and-i-cant-update-mariadb similar scenario, totally different synthome
- https://askubuntu.com/questions/1289099/mariadb-doesnt-start-on-kubuntu-20-10 exact scenario, exact synthome, different cause, caused by
Could not increase number of max_open_files
- https://askubuntu.com/questions/1228017/how-to-install-mysql-on-19-10 different scenario, different synthome, different cause, probably that user has mixed versions of MariaDB
- Unable to install MariaDB on Debian 7 different scenario, different synthome, different cause, the user is following nonsense tutorials
- https://bbs.archlinux.org/viewtopic.php?id=277078 similar scenario, different synthome, similar cause, the user has a corrupted MariaDB, but the installation had not issues
- https://www.reddit.com/r/debian/comments/17p3ted/mariadbserver_package_broken/ exact scenario, exact synthome, exact cause, but no answers, some persons think the user has a borked installation
My scenario:
- fresh Tuxedo laptop with Debian GNU/Linux bookworm (current stable, 2023) with KDE
- (this problem may happen in other Debian/Ubuntu distros with KDE)
- Run
sudo apt install mariadb-server
What happens:
MariaDB server cannot be installed and does not start correctly because something else is running:
Preparing to unpack .../04-mariadb-server_1%3a10.11.4-1~deb12u1_amd64.deb...
Failed to stop mariadb.service: Unit mariadb.service not loaded.
invoke-rc.d: initscript mariadb, action "stop" failed.
Failed to stop mysql.service: Unit mysql.service not loaded.
invoke-rc.d: initscript mysql, action "stop" failed.
Attempt to stop MariaDB/MySQL server returned exitcode 5
There is a MariaDB/MySQL server running, but we failed in our attempts to stop it.
Stop it yourself and try again!
The apt cache show mariadb-server
says that my package is 1:10.11.4-1~deb12u1
.
I've inspected a bit my situation, and indeed I have not MariaDB already installed, and indeed it's not running as root. But, I have something called "akonadi" that is running as my dedicated low-privileged desktop username and it seems it's running its dedicated MariaDB for some reasons.
I've seen in fact this unknown line in my process list, probably part of a desktop dependency:
/usr/sbin/mysqld
--defaults-file=/home/username/.local/share/akonadi/mysql.conf
--datadir=/home/username/.local/share/akonadi/db_data/
--socket=/run/user/1000/akonadi/mysql.socket
--pid-file=/run/user/1000/akonadi/mysql.pid
I think that my KDE comes as default with this package called akonadi-backend-mysql
that runs a MariaDB as default and this breaks the installation of mariadb-server
.
Does it make sense? Why? How to fix this and install mariadb-server
?