Akonadi cannot start mysql

I installed kubuntu 25.04 after my KDE Neon installation had become impossible to update. Now Akonadi cannot start mysql. The akonadi-backend-mysql has been installed, so Can't start akonadi is not relevant.

The akonadi log is:

org.kde.pim.akonadiserver: Starting up the Akonadi Server…
org.kde.pim.akonadiserver: database server stopped unexpectedly
org.kde.pim.akonadiserver: Database process exited unexpectedly during initial connection!
org.kde.pim.akonadiserver: executable: “/usr/sbin/mysqld”
org.kde.pim.akonadiserver: arguments: QList(“–defaults-file=/home/halla/.local/share/akonadi/mysql.conf”, “–dat
adir=/home/halla/.local/share/akonadi/db_data/”, “–socket=/run/user/1000/akonadi/mysql.socket”, “–pid-file=/run
/user/1000/akonadi/mysql.pid”)
org.kde.pim.akonadiserver: stdout: “”
org.kde.pim.akonadiserver: stderr: “”
org.kde.pim.akonadiserver: exit code: 1
org.kde.pim.akonadiserver: process error: “Unknown error”
org.kde.pim.akonadiserver: See “/home/halla/.local/share/akonadi/db_data/mysql.err” for more details
org.kde.pim.akonadiserver: Shutting down AkonadiServer…
org.kde.pim.akonadicontrol: Application ‘/usr/bin/akonadiserver’ exited normally…

The mysql.err log is:

2025-05-05T11:10:26.897386Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2025-05-05T11:10:27.062381Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Curre
nt value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2025-05-05T11:10:27.062413Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.4-0ubuntu2) starting as
process 7996
2025-05-05T11:10:27.063934Z 0 [Warning] [MY-013242] [Server] --character-set-server: ‘utf8’ is currently an alias
for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8M
B4 in order to be unambiguous.
2025-05-05T11:10:27.063940Z 0 [Warning] [MY-013244] [Server] --collation-server: ‘utf8mb3_general_ci’ is a collat
ion of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2025-05-05T11:10:27.066772Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_
size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=134217728. Please use in
nodb_redo_log_capacity instead.
2025-05-05T11:10:27.067682Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-05-05T11:10:27.172608Z 1 [ERROR] [MY-013894] [InnoDB] Found redo log file ./ib_logfile0 which has format (v1
349024115) and is stored outside #innodb_redo.
2025-05-05T11:10:27.172641Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error
.
2025-05-05T11:10:27.583024Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-05-05T11:10:27.583194Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-05-05T11:10:27.583203Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-05-05T11:10:27.585556Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.4-0ub
untu2) (Ubuntu).
2025-05-05T11:10:27.585565Z 0 [System] [MY-015016] [Server] MySQL Server - end.

I have also tried to remove .config/akonadi and .local/share/akonadi, but that didn’t make a difference: I still got the “Generic error” message.

Do you see any AppArmor entries in the system log?

When I reinstalled Neon last year I ran into DB startup issues due to AppArmor and I only got it to work again after copying /etc/apparmor.d from a machine with a working installation.

Good question… And yes, there are:

syslog:2025-05-05T13:10:26.896103+02:00 thinkstation kernel: audit: type=1400 audit(1746443426.894:297): apparmor =“DENIED” operation=“open” class=“file” profile=“mysqld_akonadi” name=“/sys/devices/system/node/” id=7996 comm=" mysqld" requested_mask=“r” denied_mask=“r” fsuid=1000 ouid=0

Unfortunately I haven’t had time yet to figure out which settings were different between new installation and my old one but I can send you an email with my working apparmor.d as a ZIP if you want.

Oh, that would be useful! I could do a diff then :slight_smile:

Sent :slight_smile:

Hope this lets you also get back to a working system

Got it! (Good thing I also have a web email client, though…)

Ah, yes, good point :see_no_evil_monkey:

It did do something… MySQL got started! However…

halla@thinkstation:~$ cat /home/halla/.local/share/akonadi/db_data/mysql.err
2025-05-06T08:36:28.861483Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2025-05-06T08:36:29.031918Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Curre
nt value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2025-05-06T08:36:29.031946Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.5-0ubuntu0.1) starting a
s process 216402
2025-05-06T08:36:29.033479Z 0 [Warning] [MY-013242] [Server] --character-set-server: ‘utf8’ is currently an alias
for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8M
B4 in order to be unambiguous.
2025-05-06T08:36:29.033483Z 0 [Warning] [MY-013244] [Server] --collation-server: ‘utf8mb3_general_ci’ is a collat
ion of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2025-05-06T08:36:29.036033Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_
size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=134217728. Please use in
nodb_redo_log_capacity instead.
2025-05-06T08:36:29.036928Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2025-05-06T08:36:29.133426Z 1 [ERROR] [MY-013894] [InnoDB] Found redo log file ./ib_logfile0 which has format (v1
349024115) and is stored outside #innodb_redo.
2025-05-06T08:36:29.133453Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error
.
2025-05-06T08:36:29.549881Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2025-05-06T08:36:29.550081Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.
2025-05-06T08:36:29.550100Z 0 [ERROR] [MY-010119] [Server] Aborting
2025-05-06T08:36:29.550720Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.5-0ub
untu0.1) (Ubuntu).
2025-05-06T08:36:29.550726Z 0 [System] [MY-015016] [Server] MySQL Server - end.

Can you look at the command line for mysqld during this and try to run it manually?

I once had a startup issue that got solved when I ran

/usr/sbin/mysqld --defaults-file=/home/kevin/.local/share/akonadi/mysql.conf --datadir=/home/kevin/.local/share/akonadi/db_data/ --socket=/run/user/1000/akonadi/mysql.socket --pid-file=/run/user/1000/akonadi/mysql.pid

which is what it would look like if Akonadi had started it.

Starting Akonadi manually while that was running worked (akonadictl start) and every subsequent automatic start worked as well.

Not entirely sure what the actual problem was or why manually running the DB solved it, but I am glad it did :slight_smile:

This sounds like this bug: 482442 – After update to plasma 6, akonadi can't start because mysql configuration is missing/faulty I’ve linked to a solution that worked for me.

See also this comment: 482442 – After update to plasma 6, akonadi can't start because mysql configuration is missing/faulty

In the end, the situation got so bad (trying to view thousands of mails in a web interface made me miss the notifications for this topic) that I removed the akonadi folders and started fresh…

Hello,

I encounter the same problem after an upgrade of kubuntu version 24.04 to 26.04. Here is the content of mysql.err:

2026-10-03T10:12:56.875806Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-10-03T10:12:57.251694Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2026-10-03T10:12:57.252032Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11-0ubuntu0.26.04.1) starting as process 78832
2026-10-03T10:12:57.267006Z 0 [Warning] [MY-013242] [Server] --character-set-server: ‘utf8’ is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2026-10-03T10:12:57.267025Z 0 [Warning] [MY-013244] [Server] --collation-server: ‘utf8mb3_general_ci’ is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2026-10-03T10:12:57.277543Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=134217728. Please use innodb_redo_log_capacity instead.
2026-10-03T10:12:57.291444Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has started.
2026-10-03T10:12:57.473942Z 1 [ERROR] [MY-013894] [InnoDB] Found redo log file ./ib_logfile0 which has format (v1346918739) and is stored outside #innodb_redo.2026-10-03T10:12:57.474050Z 1 [ERROR] [MY-012930] [InnoDB] Plugin initialization aborted with error Generic error.2026-10-03T10:12:57.856348Z 1 [ERROR] [MY-010334] [Server] Failed to initialize DD Storage Engine
2026-10-03T10:12:57.856600Z 0 [ERROR] [MY-010020] [Server] Data Dictionary initialization failed.2026-10-03T10:12:57.856625Z 0 [ERROR] [MY-010119] [Server] Aborting
2026-10-03T10:12:57.861161Z 0 [System] [MY-010910] [Server] /usr/sbin/mysqld: Shutdown complete (mysqld 8.4.11-0ubuntu0.26.04.1) (Ubuntu).
2026-10-03T10:12:57.861183Z 0 [System] [MY-015016] [Server] MySQL Server - end.

  1. I already tried to create the folder #innodb_redo and to move the file ib_logfile0 into it but that didn’t help (the error mysql.ibd not found appeared).
  2. I wasn’t able to install the old version 8.0 of mysql-server.
  3. Is it possible to refresh the current installation of akonadi/mysql and to synchronize the existing emails from KMail afterwards?

that ib_logfile0 format error is the old mysql 8.0 akonadi db fighting 8.4 after the upgrade. moving the redo file into #innodb_redo usually just makes a different crash.

what worked for me after a similar hop:

-akonadictl stop
-copy ~/.local/share/akonadi somewhere safe
-delete ~/.local/share/akonadi/db_data (or the whole akonadi folder if ur ok rebuilding)
-akonadictl start so it makes a fresh db
-re-add the mail/calendar accounts in kontact. imap will pull mail again

anything that only lived in local folders, make sure u have a copy first. the mysql bit is what got toast.

Thanks for the advice nite_route. I deleted ~/.local/share/akonadi/db_data and started akonadictl:

leonhard@leonhard-UX305CA:~$ akonadictl start
org.kde.pim.akonadictl: Starting Akonadi Server…
org.kde.pim.akonadictl: done.
leonhard@leonhard-UX305CA:~$ Connecting to deprecated signal QDBusConnectionInterface::serviceOwnerChanged(QString,QString,QString)
qt.qpa.services: Failed to register with host portal QDBusError(“org.freedesktop.portal.Error.Failed”, “Could not register app ID: App info not found for ‘org.kde.akonadi_control’”)
org.kde.pim.akonadiserver: Starting up the Akonadi Server…
mysqld: [ERROR] Failed to open required defaults file: /etc/xdg/akonadi/mysql-global.conf
mysqld: [ERROR] Fatal error in defaults handling. Program aborted!
org.kde.pim.akonadiserver: database server stopped unexpectedly
org.kde.pim.akonadiserver: Database process exited unexpectedly during initial connection!
org.kde.pim.akonadiserver: executable: “/usr/sbin/mysqld”
org.kde.pim.akonadiserver: arguments: QList(“–defaults-file=/home/leonhard/.local/share/akonadi/mysql.conf”, “–datadir=/home/leonhard/.local/share/akonadi/db_data/”, “–socket=/run/user/1000/akonadi/mysql.socket”, “–pid-file=/run/user/1000/akonadi/mysql.pid”)
org.kde.pim.akoCnadiserver: stdout: “”
org.kde.pim.akonadiserver: stderr: “”
org.kde.pim.akonadiserver: exit code: 3
org.kde.pim.akonadiserver: process error: “Unbekannter Fehler”
org.kde.pim.akonadiserver: See “/home/leonhard/.local/share/akonadi/db_data/mysql.err” for more details
org.kde.pim.akonadiserver: Shutting down AkonadiServer…
org.kde.pim.akonadicontrol: Application ‘/usr/bin/akonadiserver’ exited normally…

  • I don’t know why mysqld cannot open this file:
    -rw-r–r-- 1 root root 3342 Mar 6 2026 /etc/xdg/akonadi/mysql-global.conf
    Does it need write permission?
  • akonadiserver logs process error: “Unknown error”. This is the content of mysql.err:

2026-10-06T08:58:39.317453Z 0 [System] [MY-015015] [Server] MySQL Server - start.
2026-10-06T08:58:39.676873Z 0 [Warning] [MY-010097] [Server] Insecure configuration for --secure-file-priv: Current value does not restrict location of generated files. Consider setting it to a valid, non-empty path.
2026-10-06T08:58:39.676994Z 0 [System] [MY-010116] [Server] /usr/sbin/mysqld (mysqld 8.4.11-0ubuntu0.26.04.1) starting as process 22597
2026-10-06T08:58:39.683501Z 0 [Warning] [MY-013242] [Server] --character-set-server: ‘utf8’ is currently an alias for the character set UTF8MB3, but will be an alias for UTF8MB4 in a future release. Please consider using UTF8MB4 in order to be unambiguous.
2026-10-06T08:58:39.683516Z 0 [Warning] [MY-013244] [Server] --collation-server: ‘utf8mb3_general_ci’ is a collation of the deprecated character set UTF8MB3. Please consider using UTF8MB4 with an appropriate collation instead.
2026-10-06T08:58:39.713152Z 0 [Warning] [MY-010075] [Server] No existing UUID has been found, so we assume that this is the first time that this server has been started. Generating a new UUID: 1fa7172b-c164-11f1-96ba-1002b52a4739.
2026-10-06T08:58:39.742836Z 0 [Warning] [MY-013907] [InnoDB] Deprecated configuration parameters innodb_log_file_size and/or innodb_log_files_in_group have been used to compute innodb_redo_log_capacity=134217728. Please use innodb_redo_log_capacity instead.
2026-10-06T08:58:39.746285Z 1 [System] [MY-013576] [InnoDB] InnoDB initialization has austarted.
2026-10-06T08:58:39.793714Z 1 [ERROR] [MY-012592] [InnoDB] Operating system error number 2 in a file operation.
2026-10-06T08:58:39.793768Z 1 [ERROR] [MY-012593] [InnoDB] The error means the system cannot find the path specified.
2026-10-06T08:58:39.793786Z 1 [ERROR] [MY-012594] [InnoDB] If you are installing InnoDB, remember that you must create directories yourself, InnoDB does not create them.
2026-10-06T08:58:39.793809Z 1 [ERROR] [MY-012646] [InnoDB] File ./ibdata1: ‘open’ returned OS error 71. Cannot continue operation
2026-10-06T08:58:39.793832Z 1 [ERROR] [MY-012981] [InnoDB] Cannot continue operation.

  • Should I copy the old ibdata1 file into the db_data folder or create another directory?
  • I also tried to remove the whole akonadi folder but the automatic rebuilding did not work. I can post the logs if that helps.