Akonadi and MySQL bug
Table of Contents
- Akonadi and MySQL bug
Link to the bug on Launchpad
In my tests I noticed that Akonadi and all the PIM suite Kontact work fine until you do not install a MySQL server (for example, for a local LAMP server). As soon as I install the MySQL server, Akonadi stops working.
If you read the messages during the installation of MySQL server, you read something like:
Preconfiguring packages ... dpkg: mariadb-client-core-10.3: dependency problems, but removing anyway as you requested: akonadi-backend-mysql depends on mariadb-client-core-10.3 | virtual-mysql-client-core; however: Package mariadb-client-core-10.3 is to be removed. Package virtual-mysql-client-core is not installed. Package mariadb-client-core-10.3 which provides virtual-mysql-client-core is to be removed.
So, a fundamental part of Akonadi is removed, i.e.
akonadi-backend-mysql is removed, Akonadi (and all the PIM suite Kontact) doesn't work anymore.
This is very strange, because Akonadi should have its own local MySQL server (unless configured otherwise), as said in the KDE TechBase.
Akonadi should work fine both having MySQL server installed and not.
Aa a workaround, I am using the following for the moment.
Since the installation of MySQL server removed
akonadi-backend-mysql, we should tell Akonadi to use the MySQL server instead of
akonadi-backend-mysql, as said in the KDE TechBase.
Editing Akonadi configuration file
Note. The word
USER must be changed to the current system username. If you login into Linux with
john, then change
Open the file
/home/USER/.config/akonadi/akonadiserverrc. We should have something like this:
[%General] Driver=QMYSQL [QMYSQL] Host= Name=akonadi Options="UNIX_SOCKET=/run/user/1000/akonadi/mysql.socket" ServerPath=/usr/sbin/mysqld-akonadi StartServer=true
Change it in this way:
[Debug] Tracer=null [%General] Driver=QMYSQL [QMYSQL] Host=localhost Name=akonadi Options="UNIX_SOCKET=/var/run/mysqld/mysqld.sock" ServerPath=/usr/sbin/mysqld StartServer=false
Save and exit the editor.
Add your standard system user to MySQL
In the terminal type:
and then in MySQL prompt (change
USER with your username.):
CREATE USER 'USER'@'localhost' IDENTIFIED WITH auth_socket;
Please note that the username
USER is the same as the standard user in your system. Akonadi will use
USER as username to connect to MySQL via
Do not exit from MySQL prompt because we will do other operations.
Create the "akonadi" database
In MySQL prompt:
CREATE DATABASE akonadi;
Give USER the privileges on database "akonadi"
In MySQL prompt (change
USER with your username.):
GRANT ALL PRIVILEGES ON akonadi.* TO 'USER'@'localhost';
Then exit from MySQL prompt:
Try to start Akonadi
In the Bash prompt:
Akonadi should start correctly.