| Summary: | Initial database creation fails. | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] Akonadi | Reporter: | Nat <nemasu> |
| Component: | server | Assignee: | kdepim bugs <pim-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | ||
| Priority: | NOR | ||
| Version First Reported In: | 5.2.0 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | http://commits.kde.org/akonadi/37c639a158f78b810e84c84a9c42b6b63571c447 | Version Fixed/Implemented In: | 16.12.0 |
| Sentry Crash Report: | |||
Git commit 37c639a158f78b810e84c84a9c42b6b63571c447 by Daniel Vrátil. Committed on 14/09/2016 at 13:31. Pushed by dvratil into branch 'master'. Pass --basedir to mysql_install_db Based on patch from https://bugs.kde.org/367075 FIXED-IN: 16.12.0 M +12 -0 src/server/storage/dbconfigmysql.cpp http://commits.kde.org/akonadi/37c639a158f78b810e84c84a9c42b6b63571c447 |
Akonadi fails to create database on first start. MySQL back end is MariaDB. Reproducible: Always Steps to Reproduce: 1. Delete all akonadi config/data files in home directory. 2. Start Akonadi Console 3. Start/Restart Server Actual Results: Akonadi server fails to start. Errors: [Warning] Failed to open optimizer cost constant tables [ERROR] Fatal error: Can't open and lock privilege tables: Table 'mysql.user' doesn't exist [ERROR] Aborting Expected Results: Akonadi server starts successfully. I traced down the problem to mysql_install_db failing, turns out it needs an extra parameter, "--basedir=/usr" to find helper files. It starts normally after applying this patch I made (the extra search path is probably not relevant) : diff -crB akonadi-16.04.3-orig/src/server/storage/dbconfigmysql.cpp akonadi-16.04.3/src/server/storage/dbconfigmysql.cpp *** akonadi-16.04.3-orig/src/server/storage/dbconfigmysql.cpp 2016-08-17 13:48:59.195381646 +0900 --- akonadi-16.04.3/src/server/storage/dbconfigmysql.cpp 2016-08-17 13:53:12.706308135 +0900 *************** *** 78,83 **** --- 78,84 ---- #endif const QStringList mysqldSearchPath = QStringList() << QStringLiteral("/usr/sbin") + << QStringLiteral("/usr/bin") << QStringLiteral("/usr/local/sbin") << QStringLiteral("/usr/local/libexec") << QStringLiteral("/usr/libexec") *************** *** 501,506 **** --- 502,508 ---- return 0 == execute(mMysqlInstallDbPath, { QStringLiteral("--defaults-file=%1").arg(confFile), QStringLiteral("--force"), + QStringLiteral("--basedir=/usr"), QStringLiteral("--datadir=%1/").arg(dataDir) }); }