This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Akonadi and mysql

Tags: None
(comma "," separated)
workoft
Registered Member
Posts
97
Karma
1

Akonadi and mysql

Tue Feb 02, 2016 1:43 pm
Hi,

So I'm trying out kmail 15.12.1, but I'm having akonadi problems (again).
I got mysql to work (started a server via systemd without any errors, and can start a mysql console which did not work at first).
When I'm starting akonadi via akonadictl start, I'm getting this:
Code: Select all
malte@workomalte@workoft ~ $ akonadictl start
Starting Akonadi Server...
   done.
ft ~ $ /usr/bin/mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/tmp/akonadi-malte.XjcCtD/mysql.socket' (2)'
Check that mysqld is running and that the socket: '/tmp/akonadi-malte.XjcCtD/mysql.socket' exists!

The file doesn't exist. But I don't think I'm supposed to be creating it. I symlinked it to /var/run/mysqld/mysqld.sock just to see what happens - I'm getting errors because of missing privileges.
Needless to say, KMail does not work, since akonadi doesn't.
I'm on Gentoo.

Thanks!
Malte
wolfi323
Registered Member
Posts
1129
Karma
11
OS

Re: Akonadi and mysql

Tue Feb 02, 2016 5:38 pm
And what are your akonadi mysql settings? (file ~/.config/akonadi/akonadiserverrc)

These are mine, and they work fine since 7 years or so...
Code: Select all
[QMYSQL]
Host=localhost
Name=akonadi
Options=
Password=xxx
ServerPath=
StartServer=false
User=akonadi


The user and database name might differ of course.
Does the database actually exist and does the specified user have full access to it?
workoft
Registered Member
Posts
97
Karma
1

Re: Akonadi and mysql  Topic is solved

Wed Feb 03, 2016 2:44 am
Hi, thank you for your reply. I created a database using /usr/share/mysql/scripts/mysql_install_db. It should be at /var/run/mysqld/mysqld.sock, if that's actually the database. When using your settings, akonadictl start does not return any errors, but akonadictl status reveals the akonadi server is not running. And kdepim apps aren't working either.

Nevermind, I just deleted all mysql and akonadi related settings and things seem to be working so far. I don't know why I didn't think of that earlier. Thank you anyway!
wolfi323
Registered Member
Posts
1129
Karma
11
OS

Re: Akonadi and mysql

Wed Feb 03, 2016 12:28 pm
workoft wrote:Hi, thank you for your reply. I created a database using /usr/share/mysql/scripts/mysql_install_db.

You need to create a database in mysql that Akonadi can use, and specify this in Akonadi's settings.

It should be at /var/run/mysqld/mysqld.sock, if that's actually the database.

That is no database.
It is a socket to communicate with mysql, and is created when mysql is started.

When using your settings, akonadictl start does not return any errors, but akonadictl status reveals the akonadi server is not running. And kdepim apps aren't working either.

You need to modify the (mysql) username, password, and database name accordingly, as I wrote.
And again, the database must exist in mysql and the (mysql) user must have all privileges on it.

In other words, you need to create a user in mysql, then run something like this (in mysql):
Code: Select all
CREATE DATABASE akonadidb;
GRANT ALL PRIVILEGES ON akonadidb.* TO 'username'@localhost IDENTIFIED BY 'password';

Replace akonadidb, username, and password to your likings (you can use an existing user if you like), and specify them in Akonadi's config as well.

Nevermind, I just deleted all mysql and akonadi related settings and things seem to be working so far. I don't know why I didn't think of that earlier.

It will use an internal database server then.
But I thought you explicitly wanted to use the system-wide mysql server?

If that's not your intention (or you don't care), then there's nothing to do really to get Akonadi working, the defaults should be fine...
You can ignore the rest of this post in that case.


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]