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:

1 Like

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

1 Like

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…