Database Settings

From OpenSimulator

Revision as of 05:42, 24 May 2011 by Makopoppo (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


If you want to quick know the walkthrough for database setup, see #Quick Setup.

Structure

On OpenSim 0.7.1 or later, you need to set StorageProvider and ConnectionString for each data services (e.g. region database, asset service, inventory service) in the config files in config-include/. Usually you'll need to edit StandaloneCommon.ini for standalone or GridCommon.ini for grid mode.

In those files, you'll find [DatabaseService] section, which parameters control the parameters of data services in general. Only you have to care about are these two lines below:

StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"

In this case, it will connect to the database which can access by the connection string "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;" using the provider module named "OpenSim.Data.MySQL.dll".

Or, you can include another ini files. You'll find a line like that:

Include-Storage = "config-include/storage/SQLiteStandalone.ini";

It means it will go on to read config-include/storage/SQLiteStandalone.ini after reading this ini file. If you open SQLiteStandalone.ini file, you'll find StrageProvider and ConnectionString lines in each sections.


Database Parameters

Parameter Possible Values Description
StorageProvider "OpenSim.Data.SQLite.dll" (SQLite)
"OpenSim.Data.MySQL.dll" (MySQL)
"OpenSim.Data.MSSQL.dll" (Microsoft SQL Server)
The name of the storage provider modules, which can be found in bin/ folder. The three above are which OpenSim officialy (partially) supports but if you have another providers, you can freely put its name in it.
ConnectionString See #Possible Values for ConnectionString A string that OpenSim specifies information about a data source. Usually it may include the hostname or ip addresses of database server, database service names, username, schema name and password. The syntax varies between databases.
EstateConnectionString See #Possible Values for ConnectionString The same as ConnectionString, but it will be used only for Estate Service. (optional)


Possible Values for ConnectionString

(TODO: needs detail)

Example:

  • Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true; (For MySQL)
  • URI=file:db/OpenSim.db,version=3,UseUTF16Encoding=True (For SQLite)
  • Data Source=(local);Database=opensim;User=opensim;password=********; (For MSSQL)


Using Multiple Storages

Currently there are several services in OpenSim.

  • [InventoryService]
  • [AssetService]
  • [AvatarService]
  • [AuthenticationService]
  • [UserAccountService]
  • [GridUserService]
  • [FriendsService]
  • [EstateDataStore]
  • [SimulationDataStore]
  • [PresenceService]
  • [AuthorizationService]
  • [GridService]

You can use different storage for some service by overriding the same propaties in the section for those service. For example, if you are using OpenSim standalone and want to use MySQL 'opensim' in general but MySQL 'opensim2' for Inventory Service and MSSQL for Authentication Service, you'll need to write in StandaloneCommon.ini like that:

[DatabaseService]
StorageProvider = "OpenSim.Data.MySQL.dll"
ConnectionString = "Data Source=localhost;Database=opensim;User ID=opensim;Password=***;Old Guids=true;"
...
[InventoryService]
ConnectionString = "Data Source=localhost;Database=opensim2;User ID=opensim;Password=***;Old Guids=true;"
...
[AuthenticationService]
...(another parameters for authentication service)...
StorageProvider = "OpenSim.Data.MSSQL.dll"
ConnectionString = "Data Source=(local);Database=opensim;User=opensim;password=********;"

If OpenSim can't find StorageProvider or ConnectionString in each service's section, it will use those in [DatabaseService] section. If OpenSim find each or them, it will use the parameter in each service's section. Thus, then the settings in these sections override those in [DatabaseService] section.

In this case, Inventory Service will:

  • read [DatabaseService]StorageProvider
  • read [DatabaseService]ConnectionString -> read [InventoryService]ConnectionString and override

Ahthentication Service will:

  • read [DatabaseService]StorageProvider -> read [AuthenticationService]StorageProvider and override
  • raad [DatabaseService]ConnectionString -> read [AuthenticationService]ConnectionString and override

Note: SQLite and MSSQL providers don't support some services.

Note: For Estate Service, there is another parameter EstateConnectionString in [DatabaseService]. It is the middle priority between [DatabaseService] and [EstateDataStore] ConnectionStrings. OpenSim reads ConnectionString in [DatabaseService] section first, next EstateConnectionString, finally ConnectionString in [EstateDataService] section and overrides.

Quick Setup

SQLite

Out-of-the-box.

MySQL

(TODO)

MSSQL

(TODO)

Personal tools
General
About This Wiki