I abused mariadb, akonadi and kmail and cannot get it up again.

Somehow, by not using the virtual folders (I am not sure if they are called that way, because my system is German, but I hope you know what I mean) in the intended way, I managed to crash akonadi, so that kmail would not start up again - it would show a darkened screen telling me it had problems to connect to akonadi. So when I tried to start akonadi at the command line it told me, it was unable to connect to MySQL.
MySQL / MariaDB server is not starting up.

Can't connect to local MySQL server through socket '/run/mysqld/mysqld.sock'

How can I proceed from there? I would want to use Kontact once in a while ...

This post was flagged by the community and is temporarily hidden.

2 Likes
$ systemctl status mariadb
$ journalctl -b -u mariadb
systemctl status mariadb
● mariadb.service - MariaDB 10.4.13 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
     Active: inactive (dead)
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/

journalctl -b -u mariadb
-- Logs begin at Thu 2020-03-12 16:03:25 -03, end at Tue 2020-06-30 16:07:22 -03. --
-- No entries --

As you've seen - the service is disabled.
Start and/or enable it.

I did that:

systemctl start mariadb
username@hostname:~
➤ systemctl status mariadb
● mariadb.service - MariaDB 10.4.13 database server
     Loaded: loaded (/usr/lib/systemd/system/mariadb.service; disabled; vendor preset: disabled)
     Active: active (running) since Tue 2020-06-30 16:09:10 -03; 4s ago
       Docs: man:mysqld(8)
             https://mariadb.com/kb/en/library/systemd/
    Process: 89487 ExecStartPre=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exited>
    Process: 89488 ExecStartPre=/bin/sh -c [ ! -e /usr/bin/galera_recovery ] && VAR= ||   VAR=`cd /usr/bi>
    Process: 89541 ExecStartPost=/bin/sh -c systemctl unset-environment _WSREP_START_POSITION (code=exite>
   Main PID: 89501 (mysqld)
     Status: "Taking your SQL requests now..."
      Tasks: 30 (limit: 9410)
     Memory: 90.5M
     CGroup: /system.slice/mariadb.service
             └─89501 /usr/bin/mysqld

Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Waiting for purge to start
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: 10.4.13 started; log sequenc>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Loading buffer pool(s) from >
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Buffer pool(s) load complete>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] Server socket created on IP: '::'.
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] Reading of all Master_info entries s>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] Added new Master_info '' to hash tab>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] /usr/bin/mysqld: ready for connectio>
Jun 30 16:09:10 hostname mysqld[89501]: Version: '10.4.13-MariaDB'  socket: '/run/mysqld/mysqld.sock'  po>
Jun 30 16:09:10 hostname systemd[1]: Started MariaDB 10.4.13 database server.

so now I get

journalctl -b -u mariadb
-- Logs begin at Thu 2020-03-12 16:03:25 -03, end at Tue 2020-06-30 16:09:37 -03. --
Jun 30 16:09:09 hostname systemd[1]: Starting MariaDB 10.4.13 database server...
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] /usr/bin/mysqld (mysqld 10.4.13-Mari>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Warning] Could not increase number of max_>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Using Linux native AIO
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Mutexes and rw_locks use GCC>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Uses event mutexes
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Compressed tables use zlib 1>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Number of pools: 1
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Using SSE2 crc32 instructions
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] mysqld: O_TMPFILE is not supported o>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Initializing buffer pool, to>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Completed initialization of >
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: If the mysqld execution user>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: 128 out of 128 rollback segm>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Creating shared tablespace f>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Setting file './ibtmp1' size>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: File './ibtmp1' size is now >
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Waiting for purge to start
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: 10.4.13 started; log sequenc>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Loading buffer pool(s) from >
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] InnoDB: Buffer pool(s) load complete>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] Server socket created on IP: '::'.
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] Reading of all Master_info entries s>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] Added new Master_info '' to hash tab>
Jun 30 16:09:10 hostname mysqld[89501]: 2020-06-30 16:09:10 0 [Note] /usr/bin/mysqld: ready for connectio>
Jun 30 16:09:10 hostname mysqld[89501]: Version: '10.4.13-MariaDB'  socket: '/run/mysqld/mysqld.sock'  po>
Jun 30 16:09:10 hostname systemd[1]: Started MariaDB 10.4.13 database server.

looking ok, I thought, so I

➤ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server...
org.kde.pim.akonadictl:    done.
Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
username@hostname:~
username@hostname:~server: Starting up the Akonadi Server...
➤ org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/run/user/1000/akonadi/mysql.socket' (2) QMYSQL: Unable to connect"
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...

The created socket/run/mysqld/mysqld.sock is apparently different from what akonadi expects /run/user/1000/akonadi/mysql.socket.
The (system) mariadb.service might not have anything to do with that problem afterall.


edit: After a fresh install of akonadi on a test vm, it looks like it's placed it's config under $HOME/.local/share/akonadi (also see the arch wiki).
Check $HOME/.local/share/akonadi/db_data/mysql.err for errors and/or adjust $HOME/.local/share/akonadi/mysql.conf.

Ok, good to know.

User 1000, that's me and in /run/user/1000/akonadi/ there are two files
akonadiserver-cmd.socket= and akonadiserver-cmd.socket=, but no mysql.socket.
Should I create this somehow? How could I continue?

In $HOME/.local/share/akonadi/db_data/mysql.err I get a lot of these:

2020-06-30 16:21:59 0 [ERROR] mysqld: Can't lock aria control file '/home/username/.local/share/akonadi/db_data/aria_log_control' for exclusive use, error: 11.
and
2020-06-30 16:22:31 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11
2020-06-30 16:22:31 0 [Note] InnoDB: Check that you do not already have another mysqld process using the same InnoDB data or log files.
2020-06-30 16:22:32 0 [ERROR] InnoDB: Unable to lock ./ibdata1 error: 11

I wonder what that process could be. It seems that I have got only one mysqld process running. I checked the permissions on /home/username/.local/share/akonadi/db_data/aria_log_control and it belongs to my user.

Using the instructions @ https://wiki.archlinux.org/index.php/KDE#Akonadi, I swapped for postgres and apearingly it works. Let's see, how far I can get :slight_smile:

Forum kindly sponsored by