From 11d83cb737ebb12a3e6ae6c63551a0d010b90211 Mon Sep 17 00:00:00 2001
From: Sean Dague
Date: Wed, 28 May 2008 18:12:32 +0000
Subject: actually user the database_connect string for mysql. This means you
can run all the OpenSim grid services without needing a mysql_connection.ini
---
OpenSim/Data/InventoryDataBase.cs | 1 +
OpenSim/Data/MSSQL/MSSQLInventoryData.cs | 8 -------
OpenSim/Data/MySQL/MySQLInventoryData.cs | 39 ++++++++++++++++----------------
3 files changed, 20 insertions(+), 28 deletions(-)
diff --git a/OpenSim/Data/InventoryDataBase.cs b/OpenSim/Data/InventoryDataBase.cs
index 0f4799e..af480b0 100644
--- a/OpenSim/Data/InventoryDataBase.cs
+++ b/OpenSim/Data/InventoryDataBase.cs
@@ -29,5 +29,6 @@ namespace OpenSim.Data
{
public abstract class InventoryDataBase
{
+ public abstract void Initialise(string connect);
}
}
diff --git a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
index 69d45f7..0c1c3f1 100644
--- a/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
+++ b/OpenSim/Data/MSSQL/MSSQLInventoryData.cs
@@ -48,17 +48,9 @@ namespace OpenSim.Data.MSSQL
///
private MSSQLManager database;
- ///
- /// Loads and initialises this database plugin
- ///
public void Initialise(string connect)
{
// TODO: actually use the provided connect string
- Initialise();
- }
-
- public void Initialise()
- {
IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini");
string settingDataSource = GridDataMySqlFile.ParseFileReadValue("data_source");
string settingInitialCatalog = GridDataMySqlFile.ParseFileReadValue("initial_catalog");
diff --git a/OpenSim/Data/MySQL/MySQLInventoryData.cs b/OpenSim/Data/MySQL/MySQLInventoryData.cs
index 92b005d..74afe4f 100644
--- a/OpenSim/Data/MySQL/MySQLInventoryData.cs
+++ b/OpenSim/Data/MySQL/MySQLInventoryData.cs
@@ -48,28 +48,27 @@ namespace OpenSim.Data.MySQL
///
private MySQLManager database;
- ///
- /// Loads and initialises this database plugin
- ///
public void Initialise(string connect)
{
- // TODO: actually use the provided connect string
- Initialise();
- }
-
- public void Initialise()
- {
- IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
- string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
- string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
- string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
- string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
- string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
- string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
-
- database =
- new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
- settingPort);
+ if(connect != String.Empty)
+ {
+ database = new MySQLManager(connect);
+ }
+ else
+ {
+ m_log.Warn("Reverting to deprecated mysql_connection.ini file for connection info");
+ IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini");
+ string settingHostname = GridDataMySqlFile.ParseFileReadValue("hostname");
+ string settingDatabase = GridDataMySqlFile.ParseFileReadValue("database");
+ string settingUsername = GridDataMySqlFile.ParseFileReadValue("username");
+ string settingPassword = GridDataMySqlFile.ParseFileReadValue("password");
+ string settingPooling = GridDataMySqlFile.ParseFileReadValue("pooling");
+ string settingPort = GridDataMySqlFile.ParseFileReadValue("port");
+
+ database =
+ new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
+ settingPort);
+ }
TestTables(database.Connection);
}
--
cgit v1.1