On FreeBSD, the default database for Akonadi is now SQLite3. Existing users of MySQL as the database are unaffected.

“Unaffected” is perhaps not the whole truth. There’s an update to MySQL in the FreeBSD ports tree which bumps the default MySQL from 5.7 to 8.0, which happened to my workstation as well. After that, Akonadi would no longer start because MySQL wouldn’t accept the data directory. This is what I found in ~/.local/share/akonadi/db_data/mysql.err:

2023-04-24T10:38:35.832141Z 0 [System] [MY-010116] [Server]
  /usr/local/libexec/mysqld (mysqld 8.0.32) starting as process 74339
2023-04-24T10:38:35.839150Z 1 [ERROR] [MY-011011] [Server]
  Failed to find valid data directory.

Well, ok then. That’s not very helpful, and with --datadir as a command-line argument (pointing at my Akonadi data) there’s not a whole lot I think I can do.

Akonadi is “just a cache” though, so it doesnt’t really matter what’s in there, and I ended up just switching over to SQLite as the database, rather than messing around with debugging the MySQL bits.

  • akonadictl stop
  • edit ~/config/akonadi/akonadiserverrc
  • in the %General section, set the Driver line to Driver=QSQLITE
  • akonadictl start
  • watch lots of weird error messages come by, wait for a minute
  • stop and start Akonadi again, now no weird error messages.

it’s very IT crowd to have switched it off and on again, but the second time round the config file grew a QSQLITE section and an entry for the database. Going to my mail the first time after the switchover was slow because there’s who-knows-how-many messages in those IMAP boxes, and the database akonadi.db is now 106MB big, but things are back to normal.

It’s a remarkably uneventful change, which is what I like for something critical like email.