Blob Blame History Raw
From b45e783ebe548280f78c0a659a6f8c6f7e09e3ea Mon Sep 17 00:00:00 2001
From: Christophe Giboudeaux <cgiboudeaux@gmx.com>
Date: Thu, 7 Feb 2013 16:59:03 +0100
Subject: [PATCH 3/3] Ignore the custom settings in ~/.my.cnf Looks like
 passing the socket path in our arguments is not enough for MySQL. It still
 tries to run the commands on any database defined in ~/.my.cnf.

We're now adding the --defaults-file argument to mysqladmin and mysqlcheck to only run these commands on the Akonadi DB.

BUG: 264383
FIXED-IN: 1.9.1
---
 server/src/storage/dbconfigmysql.cpp | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/server/src/storage/dbconfigmysql.cpp b/server/src/storage/dbconfigmysql.cpp
index c9491e0..b76efe5 100644
--- a/server/src/storage/dbconfigmysql.cpp
+++ b/server/src/storage/dbconfigmysql.cpp
@@ -78,7 +78,8 @@ bool DbConfigMysql::init( QSettings &settings )
   const QString mysqladminPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysqladmin" ), mysqldSearchPath );
   if ( !mysqladminPath.isEmpty() ) {
 #ifndef Q_OS_WIN
-    defaultCleanShutdownCommand = QString::fromLatin1( "%1 shutdown --socket=%2/mysql.socket" )
+    defaultCleanShutdownCommand = QString::fromLatin1( "--defaults-file=%1/mysql.conf %2 shutdown --socket=%3/mysql.socket" )
+                                      .arg( AkStandardDirs::saveDir( "data" ) )
                                       .arg( mysqladminPath )
                                       .arg( socketDirectory );
 #else
@@ -303,7 +304,8 @@ void DbConfigMysql::startInternalServer()
     if ( opened ) {
 
       if ( !mMysqlCheckPath.isEmpty() ) {
-        const QStringList arguments = QStringList() << QLatin1String( "--check-upgrade" )
+        const QStringList arguments = QStringList() << QString::fromLatin1( "--defaults-file=%1/mysql.conf" ).arg( akDir )
+                                                    << QLatin1String( "--check-upgrade" )
                                                     << QLatin1String( "--all-databases" )
                                                     << QLatin1String( "--auto-repair" )
                                                     << QString::fromLatin1( "--socket=%1/mysql.socket" ).arg( socketDirectory );
-- 
1.8.1.2