Linux / Akonadi: The QtSQL driver ‘QMYSQL’ is required by your current Akonadi server configuration.
Another day brings another bug. This time it's with the Akonadi server failing or unable to start. This error followed a recent update I've done on my Fedora box. This is what greeted me each time I started up KDE:
The QtSQL driver 'QMYSQL' is required by your current Akonadi server configuration.
The following drivers are installed: QSQLITE, QMYSQL3, QMYSQL.
Make sure the required driver is installed.
Personally, I don't like uninvited guests, especially the ones that crash the party. So off I went to see what broke. The error gave some clues where I should look which included MySQL, akonadi and QtSQL. Here's how I went about resolving this one.
The solution to this one was fairly straightforward. it followed these steps:
- Open command console such as konsole
- Check if you have the config file, run: ls -al /root/.config/akonadi/mysql-local.conf
- Run echo "user=root" > /root/.config/akonadi/mysql-local.conf
- Either type kcmshell4 kcm_akonadi on the command line to start Akonadi configuration panel or follow steps 4 & 5 below.
- Go to KDE Start -> System Settings
- Under System Settings dialog click the Advanced tab then Akonadi configuration.
Click the Akonadi Server Configuration tab then the Restart button.
Getting to the solution was another matter alltogether. The first order of business was to check the akonadi server logs to narrow down the problem:
Database process existed unexpectedly during intial connection!
arguments: ("–defaults-file=/root/.local/share/akonadi//mysql.conf", "–datadir=/root/.local/share/akonadi/db_data/", "–socket=/root/.local/share/akonadi/db_misc/mysql.socket")
stderr: "090322 23:25:47 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090322 23:25:47 [Warning] option 'max_join_size': unsigned value 18446744073709551615 adjusted to 4294967295
090322 23:25:47 [ERROR] Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root!
090322 23:25:47 [ERROR] Aborting
090322 23:25:47 [Note] /usr/libexec/mysqld: Shutdown complete
exit code: 1
process error: "Unknown error"
0: akonadiserver(_Z10kBacktracev+0x35) [0x8051f75]
1: akonadiserver [0x8052456]
4: /lib/libc.so.6(gsignal+0×50) [0x1dd460]
5: /lib/libc.so.6(abort+0×188) [0x1dee28]
6: /usr/lib/libQtCore.so.4(_Z17qt_message_output9QtMsgTypePKc+0×95) [0x5886855]
7: akonadiserver(_ZN15FileDebugStream9writeDataEPKcx+0xc4) [0x8053164]
8: /usr/lib/libQtCore.so.4(_ZN9QIODevice5writeEPKcx+0x9e) [0x59143ce]
9: /usr/lib/libQtCore.so.4 [0x592139e]
10: /usr/lib/libQtCore.so.4(_ZN11QTextStreamD1Ev+0×68) [0x5921698]
11: akonadiserver(_ZN6QDebugD1Ev+0×44) [0x804d674]
12: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer20startDatabaseProcessEv+0x1a8e) [0x3f9e9e]
13: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServerC1EP7QObject+0×72) [0x3fbc02]
14: /usr/lib/libakonadiprivate.so.1(_ZN7Akonadi13AkonadiServer8instanceEv+0×56) [0x3fcd06]
15: akonadiserver(main+0×398) [0x804c9e8]
16: /lib/libc.so.6(__libc_start_main+0xe5) [0x1c86e5]
17: akonadiserver [0x804c581]
So that error narrowed down the problem alot. We now know Akonadi wants to run as the root user. Or at least is trying to run as root in an unsupported manner. First I checked with MySQL to see what they say about this even though it's an Akonadi related problem. Here's what MySQL has to say about all of this:
Further down the page we see that to run MySQL as root we need to set:
in /etc/my.cnf which for us would amount to user=root in /etc/my.cnf. The problem with this is that also according to the above MySQL page, you should never run the MySQL server as root. It's also fairly common knowledge that MySQL runs as the mysql user on Fedora Linux installations at least . So let's see what the Akonadi folks say about this I visit http://pim.kde.org/. Then choose the Akonadi link when I get there. Sadly nothing searchable could be dug up. Let's try plan B. Configuration files for applications ran from a user account, typically exist within the users home directory. So in this case let's check your ID (Assuming root here). So we run this command:
# cd ~;find ./ -name *akonadi*
So looks like we have some Akonadi stuff inside our user account. Great. Since Akonadi is giving MySQL errors it should be related. Let's dig deeper to see what we can find inside above folders:
# cd ~/.config/akonadi/
# find ./ -iname *mysql*
# cd ~/.local/share/akonadi/
# find ./ -iname *mysql*
So looks like Akonadi has it's own mysql configuration files, which is good, and perhaps for it's own purposes it needs to run as root for a local instance of mysql (What other reason is there for another MySQL config file). That would be safer. But which one of the above do I put user=root under. Checking my system, it was empty of any sort of documentation for Akonadi. So I try the RPM:
# rpm -aq|grep akonadi
# rpm -lq akonadi-1.1.1-1.fc10.i386
But all we get is another mysql config file, which isn't helpful. We need to know which one we need to set user=root in.
# vi /root/.local/share/akonadi/mysql.conf
# cat /root/.local/share/akonadi/mysql.conf|head
# Global Akonadi MySQL server settings,
# These settings can be adjusted using $HOME/.config/akonadi/mysql-local.conf
# Based on advice by Kris KÃ¶hntopp <email@example.com>
Which gives us the answer (green above) which we were looking for. Doing the above but for /etc/akonadi/mysql-global.conf instead says the same thing (files are copies of each other). Hence the SOLUTION above.
Cheers and Good Luck!