Article 4TT9C KMail won't start because of akonadi and mysql

KMail won't start because of akonadi and mysql

by
ychaouche
from LinuxQuestions.org on (#4TT9C)
When starting kmail from the command line, I can see that akonadi can't connect to mysql.

Code: ychaouche#Bahloola 18:24:07 ~/.local/share $ kmail&
[2] 7962
ychaouche#Bahloola 18:24:18 ~/.local/share $ ls akonadi-/Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
org.kde.pim.akonadiserver: Starting up the Akonadi Server...
org.kde.pim.akonadiserver: Failed to use database "akonadi"
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/tmp/akonadi-ychaouche.NL0sL9/mysql.socket' (2) QMYSQL: Unable to connect"
org.kde.pim.akonadiserver: Failed to connect to database!
org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/tmp/akonadi-ychaouche.NL0sL9/mysql.socket' (2) QMYSQL: Unable to connect"
org.kde.pim.akonadiserver: Failed to remove runtime connection config file
org.kde.pim.akonadiserver: Shutting down AkonadiServer...
org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...
No text-to-speech plug-ins were found.
org.kde.pim.akonadicore: Job error: "" for collection: QVector()

org.kde.pim.akonadicore: Job error: "" for collection: QVector()

org.kde.pim.messagelist: Failed to load tags ""
org.kde.pim.kmail: ""
org.kde.pim.kmail: ""
ychaouche#Bahloola 18:24:51 ~/.local/share $The same errors are logged in the akonadi error log Akonadi.error

Code: ychaouche#Bahloola 18:26:28 ~/.local/share/akonadi $ cat Akonadi.error
2019-11-06T18:24:21 [INFO ] org.kde.pim.akonadiserver: Starting up the Akonadi Server...
2019-11-06T18:24:21 [CRITICAL] org.kde.pim.akonadis2019-11-06T18:24:21 [INFO ] org.kde.pim.akonadicontrol: Application '/usr/bin/akonadiserver' exited normally...
: "Can't connect to local MySQL server through socket '/tmp/akonadi-ychaouche.NL0sL9/mysql.socket' (2) QMYSQL: Unable to connect"
2019-11-06T18:24:21 [CRITICAL] org.kde.pim.akonadiserver: Failed to connect to database!
2019-11-06T18:24:21 [CRITICAL] org.kde.pim.akonadiserver: Database error: "Can't connect to local MySQL server through socket '/tmp/akonadi-ychaouche.NL0sL9/mysql.socket' (2) QMYSQL: Unable to connect"
2019-11-06T18:24:21 [CRITICAL] org.kde.pim.akonadiserver: Failed to remove runtime connection config file
2019-11-06T18:24:21 [INFO ] org.kde.pim.akonadiserver: Shutting down AkonadiServer...
ychaouche#Bahloola 18:26:31 ~/.local/share/akonadi $I wonder why it couldn't connect to the database. /usr/sbin/mysqld is there, but there's no mysql file in /etc/init.d/

Code: ychaouche#Bahloola 18:28:32 ~/.local/share/akonadi $ service mysql status
Unit mysql.service could not be found.
ychaouche#Bahloola 18:29:22 ~/.local/share/akonadi $ service mysqld status
Unit mysqld.service could not be found.
ychaouche#Bahloola 18:29:24 ~/.local/share/akonadi $

I try to run mysqld from the command line, with sudo

Code: ychaouche#Bahloola 18:29:24 ~/.local/share/akonadi $ mysqld status
mysqld: Can't change dir to '/var/lib/mysql/' (Errcode: 2 - No such file or directory)
2019-11-06T17:29:56.060464Z 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --explicit_defaults_for_timestamp server option (see documentation for more details).
2019-11-06T17:29:56.060565Z 0 [Warning] Can't create test file /var/lib/mysql/Bahloola.lower-test
2019-11-06T17:29:56.060577Z 0 [Warning] Insecure configuration for --secure-file-priv: Location is accessible to all OS users. Consider choosing a different directory.
2019-11-06T17:29:56.060595Z 0 [Note] mysqld (mysqld 5.7.27-0ubuntu0.18.04.1) starting as process 8502 ...
2019-11-06T17:29:56.071141Z 0 [Warning] Can't create test file /var/lib/mysql/Bahloola.lower-test
2019-11-06T17:29:56.071158Z 0 [Warning] Can't create test file /var/lib/mysql/Bahloola.lower-test
2019-11-06T17:29:56.071189Z 0 [ERROR] failed to set datadir to /var/lib/mysql/
2019-11-06T17:29:56.071196Z 0 [ERROR] Aborting

2019-11-06T17:29:56.071208Z 0 [Note] Binlog end
2019-11-06T17:29:56.071249Z 0 [Note] mysqld: Shutdown complete

ychaouche#Bahloola 18:29:56 ~/.local/share/akonadi $
It seems many things are broken on my system, which is a fresh install of neon user 5.17

Code: ychaouche#Bahloola 18:31:09 ~/.local/share/akonadi $ lsb_release -a
No LSB modules are available.
Distributor ID: neon
Description: KDE neon User Edition 5.17
Release: 18.04
Codename: bionic
ychaouche#Bahloola 18:31:15 ~/.local/share/akonadi $latest?d=yIl2AUoC8zA latest?i=0q6p66xKYIc:_Tsk-PjejdY:F7zBnMy latest?i=0q6p66xKYIc:_Tsk-PjejdY:V_sGLiP latest?d=qj6IDK7rITs latest?i=0q6p66xKYIc:_Tsk-PjejdY:gIN9vFw0q6p66xKYIc
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments