From aec09d1565785415af0e62a71138f45b13a30618 Mon Sep 17 00:00:00 2001 From: Horst Schirmeier Date: Tue, 22 Oct 2019 18:09:05 +0200 Subject: [PATCH] Debian 10: fix loading ~/.my.cnf with MariaDB The switch to MariaDB Connector/C 3.0 involves some subtle API changes, including the fact that "~" is not expanded to the user's home directory anymore. This change expands the HOME environment variable within our code base. Change-Id: I30bc0d4fba6f0c8001832a981aa99af7e6f2a369 --- src/core/util/Database.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/util/Database.cc b/src/core/util/Database.cc index 9691f759..96a6925c 100644 --- a/src/core/util/Database.cc +++ b/src/core/util/Database.cc @@ -20,7 +20,7 @@ Database::Database(const std::string &username, const std::string &host, const s #endif CommandLine &cmd = CommandLine::Inst(); - std::string db_conf_file = "~/.my.cnf"; + std::string db_conf_file = std::string(getenv("HOME")) + "/.my.cnf"; if (cmd[DBDEFAULTS].count()) { db_conf_file = cmd[DBDEFAULTS].first()->arg; }