From c6f6218f60db023fb4c124039fd9551bc4754b13 Mon Sep 17 00:00:00 2001 From: Sean Dague Date: Thu, 24 Apr 2008 15:23:49 +0000 Subject: in theory, let you pass the mysql connection string into the mysql manager class. This could use some testing of inventory and asset services. Once this is prooved out, I'll do it for mssql as well. --- OpenSim/Data/MySQL/MySQLAssetData.cs | 8 +++++++- OpenSim/Data/MySQL/MySQLManager.cs | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) (limited to 'OpenSim/Data/MySQL') diff --git a/OpenSim/Data/MySQL/MySQLAssetData.cs b/OpenSim/Data/MySQL/MySQLAssetData.cs index b6545d7..b4a9191 100644 --- a/OpenSim/Data/MySQL/MySQLAssetData.cs +++ b/OpenSim/Data/MySQL/MySQLAssetData.cs @@ -174,7 +174,13 @@ namespace OpenSim.Data.MySQL { // TODO: This will let you pass in the connect string in // the config, though someone will need to write that. - Initialise(); + if (connect == String.Empty) { + // This is old seperate config file + Initialise(); + } else { + _dbConnection = new MySQLManager(connect); + TestTables(); + } } override public void Initialise() diff --git a/OpenSim/Data/MySQL/MySQLManager.cs b/OpenSim/Data/MySQL/MySQLManager.cs index 1e7038f..d522b78 100644 --- a/OpenSim/Data/MySQL/MySQLManager.cs +++ b/OpenSim/Data/MySQL/MySQLManager.cs @@ -65,10 +65,22 @@ namespace OpenSim.Data.MySQL public MySQLManager(string hostname, string database, string username, string password, string cpooling, string port) { + string s = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + + username + ";Password=" + password + ";Pooling=" + cpooling + ";"; + + Initialise(s); + } + + public MySQLManager(String connect) + { + Initialise(connect); + } + + public void Initialise(String connect) + { try { - connectionString = "Server=" + hostname + ";Port=" + port + ";Database=" + database + ";User ID=" + - username + ";Password=" + password + ";Pooling=" + cpooling + ";"; + connectionString = connect; dbcon = new MySqlConnection(connectionString); try -- cgit v1.1