|
Rex Dieter |
b10109 |
Index: server/src/akonadi.cpp
|
|
Rex Dieter |
b10109 |
===================================================================
|
|
Rex Dieter |
b10109 |
--- server/src/akonadi.cpp
|
|
Rex Dieter |
b10109 |
+++ server/src/akonadi.cpp 2010-03-22 10:15:12.000000000 +0100
|
|
Rex Dieter |
b10109 |
@@ -368,11 +368,15 @@
|
|
Rex Dieter |
b10109 |
void AkonadiServer::startMysqlDatabaseProcess()
|
|
Rex Dieter |
b10109 |
{
|
|
Rex Dieter |
b10109 |
const QString mysqldPath = DbConfig::serverPath();
|
|
Rex Dieter |
b10109 |
+ const QStringList mysqldSearchPath = DbConfig::mysqldSearchPath();
|
|
Rex Dieter |
b10109 |
|
|
Rex Dieter |
b10109 |
const QString dataDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_data" ) );
|
|
Rex Dieter |
b10109 |
const QString akDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/" ) );
|
|
Rex Dieter |
b10109 |
const QString miscDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/db_misc" ) );
|
|
Rex Dieter |
b10109 |
const QString fileDataDir = XdgBaseDirs::saveDir( "data", QLatin1String( "akonadi/file_db_data" ) );
|
|
Rex Dieter |
b10109 |
+ const QString mMysqlInstallDbPath = XdgBaseDirs::findExecutableFile( QLatin1String( "mysql_install_db" ), mysqldSearchPath );
|
|
Rex Dieter |
b10109 |
+ akDebug() << "Found mysql_install_db: " << mMysqlInstallDbPath;
|
|
Rex Dieter |
b10109 |
+
|
|
Rex Dieter |
b10109 |
|
|
Rex Dieter |
b10109 |
// generate config file
|
|
Rex Dieter |
b10109 |
const QString globalConfig = XdgBaseDirs::findResourceFile( "config", QLatin1String( "akonadi/mysql-global.conf" ) );
|
|
Rex Dieter |
b10109 |
@@ -443,6 +447,12 @@
|
|
Rex Dieter |
b10109 |
}
|
|
Rex Dieter |
b10109 |
}
|
|
Rex Dieter |
b10109 |
|
|
Rex Dieter |
b10109 |
+ // first run, some MySQL versions need a mysql_install_db run for that
|
|
Rex Dieter |
b10109 |
+ if ( QDir( dataDir ).entryList( QDir::NoDotAndDotDot | QDir::AllEntries ).isEmpty() && !mMysqlInstallDbPath.isEmpty() ) {
|
|
Rex Dieter |
b10109 |
+ const QStringList arguments = QStringList() << QString::fromLatin1( "--datadir=%1/" ).arg( dataDir );
|
|
Rex Dieter |
b10109 |
+ QProcess::execute( mMysqlInstallDbPath, arguments );
|
|
Rex Dieter |
b10109 |
+ }
|
|
Rex Dieter |
b10109 |
+
|
|
Rex Dieter |
b10109 |
// clear mysql ib_logfile's in case innodb_log_file_size option changed in last confUpdate
|
|
Rex Dieter |
b10109 |
if ( confUpdate ) {
|
|
Rex Dieter |
b10109 |
QFile(dataDir + QDir::separator() + QString::fromLatin1( "ib_logfile0" )).remove();
|
|
Rex Dieter |
b10109 |
Index: server/src/storage/dbconfig.cpp
|
|
Rex Dieter |
b10109 |
===================================================================
|
|
Rex Dieter |
b10109 |
--- server/src/storage/dbconfig.cpp
|
|
Rex Dieter |
b10109 |
+++ server/src/storage/dbconfig.cpp 2010-03-22 10:13:08.000000000 +0100
|
|
Rex Dieter |
b10109 |
@@ -299,3 +299,15 @@
|
|
Rex Dieter |
b10109 |
return sInstance()->mCleanServerShutdownCommand;
|
|
Rex Dieter |
b10109 |
}
|
|
Rex Dieter |
b10109 |
|
|
Rex Dieter |
b10109 |
+QStringList DbConfig::mysqldSearchPath()
|
|
Rex Dieter |
b10109 |
+{
|
|
Rex Dieter |
b10109 |
+const QStringList mysqldSearchPath = QStringList()
|
|
Rex Dieter |
b10109 |
+ << QLatin1String("/usr/sbin")
|
|
Rex Dieter |
b10109 |
+ << QLatin1String("/usr/local/sbin")
|
|
Rex Dieter |
b10109 |
+ << QLatin1String("/usr/local/libexec")
|
|
Rex Dieter |
b10109 |
+ << QLatin1String("/usr/libexec")
|
|
Rex Dieter |
b10109 |
+ << QLatin1String("/opt/mysql/libexec")
|
|
Rex Dieter |
b10109 |
+ << QLatin1String("/opt/local/lib/mysql5/bin");
|
|
Rex Dieter |
b10109 |
+
|
|
Rex Dieter |
b10109 |
+ return mysqldSearchPath ;
|
|
Rex Dieter |
b10109 |
+}
|
|
Rex Dieter |
b10109 |
Index: server/src/storage/dbconfig.h
|
|
Rex Dieter |
b10109 |
===================================================================
|
|
Rex Dieter |
b10109 |
--- server/src/storage/dbconfig.h
|
|
Rex Dieter |
b10109 |
+++ server/src/storage/dbconfig.h 2010-03-22 10:14:28.000000000 +0100
|
|
Rex Dieter |
b10109 |
@@ -76,6 +76,11 @@
|
|
Rex Dieter |
b10109 |
* exists.
|
|
Rex Dieter |
b10109 |
*/
|
|
Rex Dieter |
b10109 |
QString cleanServerShutdownCommand();
|
|
Rex Dieter |
b10109 |
+
|
|
Rex Dieter |
b10109 |
+ /**
|
|
Rex Dieter |
b10109 |
+ * Returns the path where mysql binaries are searched
|
|
Rex Dieter |
b10109 |
+ */
|
|
Rex Dieter |
b10109 |
+ QStringList mysqldSearchPath() ;
|
|
Rex Dieter |
b10109 |
}
|
|
Rex Dieter |
b10109 |
|
|
Rex Dieter |
b10109 |
#endif
|