aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-09-14 13:31:12 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-09-14 13:31:24 (GMT)
commit37c639a158f78b810e84c84a9c42b6b63571c447 (patch)
tree331873643ce9a3771232c96f764e7b33f94bd4ed
parent2ef0fe95bd83643d0a1e69b0b59124fa76be5b2f (diff)
Pass --basedir to mysql_install_db
Based on patch from https://bugs.kde.org/367075 BUG: 367075 FIXED-IN: 16.12.0
-rw-r--r--src/server/storage/dbconfigmysql.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/server/storage/dbconfigmysql.cpp b/src/server/storage/dbconfigmysql.cpp
index a7397c1..5cfaa33 100644
--- a/src/server/storage/dbconfigmysql.cpp
+++ b/src/server/storage/dbconfigmysql.cpp
@@ -76,6 +76,7 @@ bool DbConfigMysql::init(QSettings &settings)
}
#endif
const QStringList mysqldSearchPath = QStringList()
+ << QStringLiteral("/usr/bin")
<< QStringLiteral("/usr/sbin")
<< QStringLiteral("/usr/local/sbin")
<< QStringLiteral("/usr/local/libexec")
@@ -504,9 +505,14 @@ int DbConfigMysql::parseCommandLineToolsVersion() const
bool DbConfigMysql::initializeMariaDBDatabase(const QString &confFile, const QString &dataDir) const
{
+ QFileInfo fi(mMysqlInstallDbPath);
+ QDir dir = fi.dir();
+ dir.cdUp();
+ const QString baseDir = dir.absolutePath();
return 0 == execute(mMysqlInstallDbPath,
{ QStringLiteral("--defaults-file=%1").arg(confFile),
QStringLiteral("--force"),
+ QStringLiteral("--basedir=%1").arg(baseDir),
QStringLiteral("--datadir=%1/").arg(dataDir) });
}
@@ -524,8 +530,14 @@ bool DbConfigMysql::initializeMySQL5_7_6Database(const QString &confFile, const
bool DbConfigMysql::initializeMySQLDatabase(const QString &confFile, const QString &dataDir) const
{
+ QFileInfo fi(mMysqlInstallDbPath);
+ QDir dir = fi.dir();
+ dir.cdUp();
+ const QString baseDir = dir.absolutePath();
+
// Don't use --force, it has been removed in MySQL 5.7.5
return 0 == execute(mMysqlInstallDbPath,
{ QStringLiteral("--defaults-file=%1").arg(confFile),
+ QStringLiteral("--basedir=%1").arg(baseDir),
QStringLiteral("--datadir=%1/").arg(dataDir) });
}