actually user the database_connect string for mysql.

This means you can run all the OpenSim grid services without
needing a mysql_connection.ini
0.6.0-stable
Sean Dague 2008-05-28 18:12:32 +00:00
parent 89c164fbc1
commit 11d83cb737
3 changed files with 20 additions and 28 deletions

View File

@ -29,5 +29,6 @@ namespace OpenSim.Data
{ {
public abstract class InventoryDataBase public abstract class InventoryDataBase
{ {
public abstract void Initialise(string connect);
} }
} }

View File

@ -48,17 +48,9 @@ namespace OpenSim.Data.MSSQL
/// </summary> /// </summary>
private MSSQLManager database; private MSSQLManager database;
/// <summary>
/// Loads and initialises this database plugin
/// </summary>
public void Initialise(string connect) public void Initialise(string connect)
{ {
// TODO: actually use the provided connect string // TODO: actually use the provided connect string
Initialise();
}
public void Initialise()
{
IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini"); IniFile GridDataMySqlFile = new IniFile("mssql_connection.ini");
string settingDataSource = GridDataMySqlFile.ParseFileReadValue("data_source"); string settingDataSource = GridDataMySqlFile.ParseFileReadValue("data_source");
string settingInitialCatalog = GridDataMySqlFile.ParseFileReadValue("initial_catalog"); string settingInitialCatalog = GridDataMySqlFile.ParseFileReadValue("initial_catalog");

View File

@ -48,28 +48,27 @@ namespace OpenSim.Data.MySQL
/// </summary> /// </summary>
private MySQLManager database; private MySQLManager database;
/// <summary>
/// Loads and initialises this database plugin
/// </summary>
public void Initialise(string connect) public void Initialise(string connect)
{ {
// TODO: actually use the provided connect string if(connect != String.Empty)
Initialise(); {
} 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");
public void Initialise() database =
{ new MySQLManager(settingHostname, settingDatabase, settingUsername, settingPassword, settingPooling,
IniFile GridDataMySqlFile = new IniFile("mysql_connection.ini"); settingPort);
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); TestTables(database.Connection);
} }