Help:Configuration parameter "$smwgLocalConnectionConf"

Jump to: navigation, search
edit with form (experimental)

Title $smwgLocalConnectionConf
Description Sets the database connection characteristics for providers used
Default setting See below
Software Semantic MediaWiki
First version supported 2.5.3
Last version supported still available
Configuration Installation
Keyword Database connector · database · setup · backend · SQLStore · store

$smwgLocalConnectionConf is a configuration parameter that sets the database connection characteristics for providers used. The setting was introduced in Semantic MediaWiki

NoteNote: This configuration parameter may only be used in connection with the usage of a relational database as set with configuration parameter $smwgDefaultStore
Sets the storage backend to be used for the semantic data

Default setting

$smwgLocalConnectionConf => array(
	'mw.db' => array(
		'read'  => DB_SLAVE,
		'write' => DB_MASTER
	'mw.db.queryengine' => array(
		'read'  => DB_SLAVE,
		'write' => DB_MASTER
NoteNote: The default setting will be logged as {"read":-1,"write":-2}

Available options and parameters

  • mw.db - Defines the data storage setup
  • mw.db.queryengine - Defines the data retrieval setup
  • DB_MASTER - Specifies the master database
  • DB_SLAVE - Specifies the slave database
  • DB_REPLICA - Specifies the replica slave database (MediaWiki 1.28 and later)

Changing the default setting

Important noteImportant Note: Changes to this configuration parameter should ONLY be made by trained professionals to avoid unexpected or unanticipated results when using connection handlers.

To modify this configuration setting, add one of the following lines to your "LocalSettings.php" file after the enableSemantics() call:

Allow to cater for a multi database setup with master and slave databases (data retrieval)
$smwgLocalConnectionConf['mw.db.queryengine'] = array(
	'read' => DB_SLAVE,
	'write' => DB_SLAVE

See also


  1. ^  Semantic MediaWiki: GitHub pull request gh:smw:2534