From f00cd5574602dcbfc40a7a79a2661a367c54fb0f Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Wed, 1 Dec 2004 13:15:13 +0000 Subject: [PATCH] Add basic support for table prefixes to the installer. (Probably will fail on upgrades yet.) .sql files should still be usable 'raw' on a wiki with no prefix. --- config/index.php | 59 +++++++----- install-utils.inc | 4 +- maintenance/InitialiseMessages.inc | 2 +- .../patch-userlevels-defaultgroups.sql | 8 +- maintenance/changeuser.sql | 16 ++-- maintenance/interwiki.sql | 2 +- maintenance/recount.sql | 4 +- maintenance/tables.sql | 56 +++++------ maintenance/users.sql | 96 ------------------- maintenance/wikipedia-interwiki.sql | 2 +- maintenance/wiktionary-interwiki.sql | 2 +- 11 files changed, 82 insertions(+), 169 deletions(-) diff --git a/config/index.php b/config/index.php index 67e8789111..c5c65c5276 100644 --- a/config/index.php +++ b/config/index.php @@ -321,6 +321,7 @@ print "
  • Script URI path: " . htmlspecialchars( $conf->ScriptPath ) . "DBuser = importPost( "DBuser", "wikiuser" ); $conf->DBpassword = importPost( "DBpassword" ); $conf->DBpassword2 = importPost( "DBpassword2" ); + $conf->DBprefix = importPost( "DBprefix" ); $conf->RootPW = importPost( "RootPW" ); $conf->LanguageCode = importPost( "LanguageCode", "en" ); $conf->SysopName = importPost( "SysopName", "WikiSysop" ); @@ -342,6 +343,9 @@ if( $conf->DBpassword == "" ) { if( $conf->DBpassword != $conf->DBpassword2 ) { $errs["DBpassword2"] = "Passwords don't match!"; } +if( !preg_match( '/^[A-Za-z_0-9]*$/', $conf->DBprefix ) ) { + $errs["DBprefix"] = "Invalid table prefix"; +} if( $conf->SysopPass == "" ) { $errs["SysopPass"] = "Must not be blank"; @@ -394,6 +398,7 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { eval($local); $wgDBadminuser = "root"; $wgDBadminpassword = $conf->RootPW; + $wgDBprefix = $conf->DBprefix; $wgCommandLineMode = true; $wgUseDatabaseMessages = false; /* FIXME: For database failure */ require_once( "includes/Setup.php" ); @@ -514,8 +519,11 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print " done.
  • \n"; print "
  • Initializing data..."; - $wgDatabase->query( "INSERT INTO site_stats (ss_row_id,ss_total_views," . - "ss_total_edits,ss_good_articles) VALUES (1,0,0,0)" ); + $wgDatabase->insert( 'site_stats', + array( 'ss_row_id' => 1, + 'ss_total_views' => 0, + 'ss_total_edits' => 0, + 'ss_good_articles' => 0 ) ); # setting up the db user if( $conf->Root ) { print "
  • Granting user permissions...
  • \n"; @@ -539,32 +547,19 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print "
  • Skipped sysop account creation, no name given.
  • \n"; } - print "
  • Initialising log pages..."; - $logs = array( - "uploadlogpage" => "uploadlogpagetext", - "dellogpage" => "dellogpagetext", - "protectlogpage" => "protectlogtext", - "blocklogpage" => "blocklogtext" - ); - $metaNamespace = Namespace::getWikipedia(); + $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); $now = wfTimestampNow(); $won = wfInvertTimestamp( $now ); - foreach( $logs as $page => $text ) { - $logTitle = $wgDatabase->strencode( $wgLang->ucfirst( str_replace( " ", "_", wfMsgNoDB( $page ) ) ) ); - $logText = $wgDatabase->strencode( wfMsgNoDB( $text ) ); - $wgDatabase->query( "INSERT INTO cur (cur_namespace,cur_title,cur_text," . - "cur_restrictions,cur_timestamp,inverse_timestamp,cur_touched) " . - "VALUES ($metaNamespace,'$logTitle','$logText','sysop','$now','$won','$now')" ); - } - print "
  • \n"; - - $titleobj = Title::newFromText( wfMsgNoDB( "mainpage" ) ); - $title = $titleobj->getDBkey(); - $sql = "INSERT INTO cur (cur_namespace,cur_title,cur_text,cur_timestamp,inverse_timestamp,cur_touched,cur_user,cur_user_text) " . - "VALUES (0,'$title','" . - wfStrencode( wfMsg( "mainpagetext" ) . "\n\n" . wfMsg( "mainpagedocfooter" ) ) . - "','$now','$won','$now',0,'MediaWiki default')"; - $wgDatabase->query( $sql, $fname ); + $wgDatabase->insert( 'cur', + array( 'cur_namespace' => $titleobj->getNamespace(), + 'cur_title' => $titleobj->getDBkey(), + 'cur_text' => wfMsg( 'mainpagetext' ) . "\n\n" . + wfMsg( 'mainpagedocfooter' ), + 'cur_timestamp' => $now, + 'inverse_timestamp' => $won, + 'cur_touched' => $now, + 'cur_user' => 0, + 'cur_user_text' => 'MediaWiki default' ) ); print "
  • ";
     			initialiseMessages();
    @@ -767,6 +762,16 @@ if( count( $errs ) ) {
     		you can specify new accounts/databases to be created.
     	
     
    +	
    +
    +

    If you need to share one database between multiple wikis, or + MediaWiki and another web application, you may choose to + add a prefix to all the table names to avoid conflicts.

    + +

    Avoid exotic characters; something like mw_ is good.

    +
    DBmysql4}; ## Shared memory settings diff --git a/install-utils.inc b/install-utils.inc index 1fb2cc8e82..105818d400 100644 --- a/install-utils.inc +++ b/install-utils.inc @@ -72,12 +72,14 @@ function replacevars( $ins ) { $varnames = array( "wgDBserver", "wgDBname", "wgDBintlname", "wgDBuser", "wgDBpassword", "wgDBsqluser", "wgDBsqlpassword", - "wgDBadminuser", "wgDBadminpassword" + "wgDBadminuser", "wgDBadminpassword", "wgDBprefix" ); foreach ( $varnames as $var ) { global $$var; $ins = str_replace( '{$' . $var . '}', $$var, $ins ); + $ins = str_replace( '/*$' . $var . '*/`', '`' . $$var, $ins ); + $ins = str_replace( '/*$' . $var . '*/', $$var, $ins ); } return $ins; } diff --git a/maintenance/InitialiseMessages.inc b/maintenance/InitialiseMessages.inc index f3e3623824..755ccdcedc 100755 --- a/maintenance/InitialiseMessages.inc +++ b/maintenance/InitialiseMessages.inc @@ -180,7 +180,7 @@ function initialiseMessagesReal( $overwrite = false, $messageArray = false ) { } } - $dbw->insert( $cur, $arr, $fname ); + $dbw->insert( 'cur', $arr, $fname ); # Clear the relevant memcached key print 'Clearing message cache...'; diff --git a/maintenance/archives/patch-userlevels-defaultgroups.sql b/maintenance/archives/patch-userlevels-defaultgroups.sql index 0871cdb834..fac0476bbf 100644 --- a/maintenance/archives/patch-userlevels-defaultgroups.sql +++ b/maintenance/archives/patch-userlevels-defaultgroups.sql @@ -3,11 +3,11 @@ -- Should probably be inserted when someone create a new database -- -INSERT INTO `group` (group_id,group_name,group_description,group_rights) +INSERT INTO /*$wgDBprefix*/`group` (group_id,group_name,group_description,group_rights) VALUES (1,'Anonymous','Anonymous users','read,edit,createaccount'); -INSERT INTO `group` (group_id,group_name,group_description,group_rights) +INSERT INTO /*$wgDBprefix*/`group` (group_id,group_name,group_description,group_rights) VALUES (2,'Loggedin','General logged in users','read,edit,move,upload'); -INSERT INTO `group` (group_id,group_name,group_description,group_rights) +INSERT INTO /*$wgDBprefix*/`group` (group_id,group_name,group_description,group_rights) VALUES (3,'Sysops','Operators of this site','read,edit,move,delete,undelete,protect,block,upload,asksql,rollback,patrol,editinterface,sysop'); -INSERT INTO `group` (group_id,group_name,group_description,group_rights) +INSERT INTO /*$wgDBprefix*/`group` (group_id,group_name,group_description,group_rights) VALUES (4,'Bureaucrat','The bureaucrat group is able to make sysops for example. They have no other rights.','read,edit,move,delete,undelete,protect,block,userrights,createaccount,upload,asksql,rollback,patrol,editinterface,siteadmin,sysop'); diff --git a/maintenance/changeuser.sql b/maintenance/changeuser.sql index f6e5cf8921..ad1c6da6ff 100644 --- a/maintenance/changeuser.sql +++ b/maintenance/changeuser.sql @@ -1,12 +1,12 @@ set @oldname = 'At18'; set @newname = 'Alfio'; -update low_priority user set user_name=@newname where user_name=@oldname; -update low_priority user_newtalk set user_ip=@newname where user_ip=@oldname; -update low_priority cur set cur_user_text=@newname where cur_user_text=@oldname; -update low_priority old set old_user_text=@newname where old_user_text=@oldname; -update low_priority archive set ar_user_text=@newname where ar_user_text=@oldname; -update low_priority ipblocks set ipb_address=@newname where ipb_address=@oldname; -update low_priority oldimage set oi_user_text=@newname where oi_user_text=@oldname; -update low_priority recentchanges set rc_user_text=@newname where rc_user_text=@oldname; +update low_priority /*$wgDBprefix*/user set user_name=@newname where user_name=@oldname; +update low_priority /*$wgDBprefix*/user_newtalk set user_ip=@newname where user_ip=@oldname; +update low_priority /*$wgDBprefix*/cur set cur_user_text=@newname where cur_user_text=@oldname; +update low_priority /*$wgDBprefix*/old set old_user_text=@newname where old_user_text=@oldname; +update low_priority /*$wgDBprefix*/archive set ar_user_text=@newname where ar_user_text=@oldname; +update low_priority /*$wgDBprefix*/ipblocks set ipb_address=@newname where ipb_address=@oldname; +update low_priority /*$wgDBprefix*/oldimage set oi_user_text=@newname where oi_user_text=@oldname; +update low_priority /*$wgDBprefix*/recentchanges set rc_user_text=@newname where rc_user_text=@oldname; diff --git a/maintenance/interwiki.sql b/maintenance/interwiki.sql index e625552ee3..1b04ee976f 100644 --- a/maintenance/interwiki.sql +++ b/maintenance/interwiki.sql @@ -1,7 +1,7 @@ -- Based more or less on the public interwiki map from MeatballWiki -- Default interwiki prefixes... -REPLACE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES +REPLACE INTO /*$wgDBprefix*/interwiki (iw_prefix,iw_url,iw_local) VALUES ('AbbeNormal','http://www.ourpla.net/cgi-bin/pikie.cgi?$1',0), ('AcadWiki','http://xarch.tu-graz.ac.at/autocad/wiki/$1',0), ('Acronym','http://www.acronymfinder.com/af-query.asp?String=exact&Acronym=$1',0), diff --git a/maintenance/recount.sql b/maintenance/recount.sql index 93e1024b4f..2bf4a7fba8 100644 --- a/maintenance/recount.sql +++ b/maintenance/recount.sql @@ -2,7 +2,7 @@ -- Recalculate the article count -- -SELECT @foo:=COUNT(*) FROM cur +SELECT @foo:=COUNT(*) FROM /*$wgDBprefix*/cur WHERE cur_namespace=0 AND cur_is_redirect=0 AND cur_text like '%[[%'; -UPDATE site_stats SET ss_good_articles=@foo; +UPDATE /*$wgDBprefix*/site_stats SET ss_good_articles=@foo; diff --git a/maintenance/tables.sql b/maintenance/tables.sql index db2c0704ce..67596d78cf 100644 --- a/maintenance/tables.sql +++ b/maintenance/tables.sql @@ -4,7 +4,7 @@ -- -- Indexes should be defined here; please import the rest from indexes.sql. -CREATE TABLE user ( +CREATE TABLE /*$wgDBprefix*/user ( user_id int(5) unsigned NOT NULL auto_increment, user_name varchar(255) binary NOT NULL default '', user_real_name varchar(255) binary NOT NULL default '', @@ -19,20 +19,20 @@ CREATE TABLE user ( ); -- TODO: de-blob this; it should be a property table -CREATE TABLE user_rights ( +CREATE TABLE /*$wgDBprefix*/user_rights ( ur_user int(5) unsigned NOT NULL, ur_rights tinyblob NOT NULL default '', UNIQUE KEY ur_user (ur_user) ); -CREATE TABLE user_newtalk ( +CREATE TABLE /*$wgDBprefix*/user_newtalk ( user_id int(5) NOT NULL default '0', user_ip varchar(40) NOT NULL default '', INDEX user_id (user_id), INDEX user_ip (user_ip) ); -CREATE TABLE cur ( +CREATE TABLE /*$wgDBprefix*/cur ( cur_id int(8) unsigned NOT NULL auto_increment, cur_namespace tinyint(2) unsigned NOT NULL default '0', cur_title varchar(255) binary NOT NULL default '', @@ -63,7 +63,7 @@ CREATE TABLE cur ( INDEX namespace_redirect_timestamp(cur_namespace,cur_is_redirect,cur_timestamp) ); -CREATE TABLE old ( +CREATE TABLE /*$wgDBprefix*/old ( old_id int(8) unsigned NOT NULL auto_increment, old_namespace tinyint(2) unsigned NOT NULL default '0', old_title varchar(255) binary NOT NULL default '', @@ -83,7 +83,7 @@ CREATE TABLE old ( INDEX usertext_timestamp (old_user_text,inverse_timestamp) ); -CREATE TABLE archive ( +CREATE TABLE /*$wgDBprefix*/archive ( ar_namespace tinyint(2) unsigned NOT NULL default '0', ar_title varchar(255) binary NOT NULL default '', ar_text mediumtext NOT NULL default '', @@ -101,7 +101,7 @@ CREATE TABLE archive ( -- Track links that do exist -- l_from and l_to key to cur_id -- -CREATE TABLE links ( +CREATE TABLE /*$wgDBprefix*/links ( l_from int(8) unsigned NOT NULL default '0', l_to int(8) unsigned NOT NULL default '0', UNIQUE KEY l_from(l_from,l_to), @@ -113,7 +113,7 @@ CREATE TABLE links ( -- bl_from keys to cur_id -- bl_to is a text link (namespace:title) -- -CREATE TABLE brokenlinks ( +CREATE TABLE /*$wgDBprefix*/brokenlinks ( bl_from int(8) unsigned NOT NULL default '0', bl_to varchar(255) binary NOT NULL default '', UNIQUE KEY bl_from(bl_from,bl_to), @@ -125,7 +125,7 @@ CREATE TABLE brokenlinks ( -- il_from keys to cur_id, il_to keys to image_name. -- We don't distinguish live from broken links. -- -CREATE TABLE imagelinks ( +CREATE TABLE /*$wgDBprefix*/imagelinks ( il_from int(8) unsigned NOT NULL default '0', il_to varchar(255) binary NOT NULL default '', UNIQUE KEY il_from(il_from,il_to), @@ -138,7 +138,7 @@ CREATE TABLE imagelinks ( -- cl_sortkey is the title of the linking page or an optional override -- cl_timestamp marks when the link was last added -- -CREATE TABLE categorylinks ( +CREATE TABLE /*$wgDBprefix*/categorylinks ( cl_from int(8) unsigned NOT NULL default '0', cl_to varchar(255) binary NOT NULL default '', cl_sortkey varchar(255) binary NOT NULL default '', @@ -153,12 +153,12 @@ CREATE TABLE categorylinks ( -- cache arrays to reduce database load slurping up -- from links and brokenlinks. -- -CREATE TABLE linkscc ( +CREATE TABLE /*$wgDBprefix*/linkscc ( lcc_pageid INT UNSIGNED NOT NULL UNIQUE KEY, lcc_cacheobj MEDIUMBLOB NOT NULL ); -CREATE TABLE site_stats ( +CREATE TABLE /*$wgDBprefix*/site_stats ( ss_row_id int(8) unsigned NOT NULL, ss_total_views bigint(20) unsigned default '0', ss_total_edits bigint(20) unsigned default '0', @@ -166,11 +166,11 @@ CREATE TABLE site_stats ( UNIQUE KEY ss_row_id (ss_row_id) ); -CREATE TABLE hitcounter ( +CREATE TABLE /*$wgDBprefix*/hitcounter ( hc_id INTEGER UNSIGNED NOT NULL ) TYPE=HEAP MAX_ROWS=25000; -CREATE TABLE ipblocks ( +CREATE TABLE /*$wgDBprefix*/ipblocks ( ipb_id int(8) NOT NULL auto_increment, ipb_address varchar(40) binary NOT NULL default '', ipb_user int(8) unsigned NOT NULL default '0', @@ -185,7 +185,7 @@ CREATE TABLE ipblocks ( INDEX ipb_user (ipb_user) ); -CREATE TABLE image ( +CREATE TABLE /*$wgDBprefix*/image ( img_name varchar(255) binary NOT NULL default '', img_size int(8) unsigned NOT NULL default '0', img_description tinyblob NOT NULL default '', @@ -197,7 +197,7 @@ CREATE TABLE image ( INDEX img_timestamp (img_timestamp) ); -CREATE TABLE oldimage ( +CREATE TABLE /*$wgDBprefix*/oldimage ( oi_name varchar(255) binary NOT NULL default '', oi_archive_name varchar(255) binary NOT NULL default '', oi_size int(8) unsigned NOT NULL default 0, @@ -208,7 +208,7 @@ CREATE TABLE oldimage ( INDEX oi_name (oi_name(10)) ); -CREATE TABLE recentchanges ( +CREATE TABLE /*$wgDBprefix*/recentchanges ( rc_id int(8) NOT NULL auto_increment, rc_timestamp varchar(14) binary NOT NULL default '', rc_cur_time varchar(14) binary NOT NULL default '', @@ -237,7 +237,7 @@ CREATE TABLE recentchanges ( INDEX rc_ip (rc_ip) ); -CREATE TABLE watchlist ( +CREATE TABLE /*$wgDBprefix*/watchlist ( wl_user int(5) unsigned NOT NULL, wl_namespace tinyint(2) unsigned NOT NULL default '0', wl_title varchar(255) binary NOT NULL default '', @@ -245,7 +245,7 @@ CREATE TABLE watchlist ( KEY namespace_title (wl_namespace,wl_title) ); -CREATE TABLE math ( +CREATE TABLE /*$wgDBprefix*/math ( math_inputhash varchar(16) NOT NULL, math_outputhash varchar(16) NOT NULL, math_html_conservativeness tinyint(1) NOT NULL, @@ -257,7 +257,7 @@ CREATE TABLE math ( -- Table searchindex must be MyISAM for fulltext support -CREATE TABLE searchindex ( +CREATE TABLE /*$wgDBprefix*/searchindex ( si_page int(8) unsigned NOT NULL, si_title varchar(255) NOT NULL default '', si_text mediumtext NOT NULL default '', @@ -267,7 +267,7 @@ CREATE TABLE searchindex ( ) TYPE=MyISAM; -CREATE TABLE interwiki ( +CREATE TABLE /*$wgDBprefix*/interwiki ( iw_prefix char(32) NOT NULL, iw_url char(127) NOT NULL, iw_local BOOL NOT NULL, @@ -275,7 +275,7 @@ CREATE TABLE interwiki ( ); -- Used for caching expensive grouped queries -CREATE TABLE querycache ( +CREATE TABLE /*$wgDBprefix*/querycache ( qc_type char(32) NOT NULL, qc_value int(5) unsigned NOT NULL default '0', qc_namespace tinyint(2) unsigned NOT NULL default '0', @@ -284,7 +284,7 @@ CREATE TABLE querycache ( ); -- For a few generic cache operations if not using Memcached -CREATE TABLE objectcache ( +CREATE TABLE /*$wgDBprefix*/objectcache ( keyname char(255) binary not null default '', value mediumblob, exptime datetime, @@ -293,7 +293,7 @@ CREATE TABLE objectcache ( ); -- For storing revision text -CREATE TABLE blobs ( +CREATE TABLE /*$wgDBprefix*/blobs ( blob_index char(255) binary NOT NULL default '', blob_data longblob NOT NULL default '', UNIQUE key blob_index (blob_index) @@ -301,7 +301,7 @@ CREATE TABLE blobs ( -- For article validation -CREATE TABLE `validate` ( +CREATE TABLE /*$wgDBprefix*/validate ( `val_user` int(11) NOT NULL default '0', `val_title` varchar(255) binary NOT NULL default '', `val_timestamp` varchar(14) binary NOT NULL default '', @@ -312,7 +312,7 @@ CREATE TABLE `validate` ( ); -CREATE TABLE logging ( +CREATE TABLE /*$wgDBprefix*/logging ( -- Symbolic keys for the general log type and the action type -- within the log. The output format will be controlled by the -- action field, but only the type controls categorization. @@ -343,7 +343,7 @@ CREATE TABLE logging ( -- Hold group name and description -CREATE TABLE `group` ( +CREATE TABLE /*$wgDBprefix*/`group` ( group_id int(5) unsigned NOT NULL auto_increment, group_name varchar(50) NOT NULL default '', group_description varchar(255) NOT NULL default '', @@ -352,7 +352,7 @@ CREATE TABLE `group` ( ); -- Relation table between user and groups -CREATE TABLE user_groups ( +CREATE TABLE /*$wgDBprefix*/user_groups ( ug_user int(5) unsigned NOT NULL default '0', ug_group int(5) unsigned NOT NULL default '0', PRIMARY KEY (ug_user,ug_group) diff --git a/maintenance/users.sql b/maintenance/users.sql index dc23ed356f..4d74987b31 100644 --- a/maintenance/users.sql +++ b/maintenance/users.sql @@ -17,99 +17,3 @@ GRANT DELETE,INSERT,SELECT,UPDATE ON `{$wgDBname}`.* TO {$wgDBuser}@localhost IDENTIFIED BY '{$wgDBpassword}'; GRANT DELETE,INSERT,SELECT,UPDATE ON `{$wgDBname}`.* TO {$wgDBuser}@localhost.localdomain IDENTIFIED BY '{$wgDBpassword}'; - -GRANT SELECT (user_id,user_name,user_options) ON `{$wgDBname}`.user - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.user_rights - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.cur - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.old - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.archive - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.links - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.brokenlinks - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.imagelinks - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.site_stats - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.ipblocks - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.image - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.oldimage - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.recentchanges - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.watchlist - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.math - TO {$wgDBsqluser}@'%' IDENTIFIED BY '{$wgDBsqlpassword}'; - -GRANT SELECT (user_id,user_name,user_options) - ON `{$wgDBname}`.user - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.user_rights - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.cur - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.old - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.archive - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.links - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.brokenlinks - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.imagelinks - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.site_stats - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.ipblocks - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.image - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.oldimage - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.recentchanges - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.watchlist - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.math - TO {$wgDBsqluser}@localhost IDENTIFIED BY '{$wgDBsqlpassword}'; - -GRANT SELECT (user_id,user_name,user_options) - ON `{$wgDBname}`.user - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.user_rights - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.cur - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.old - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.archive - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.links - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.brokenlinks - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.imagelinks - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.site_stats - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.ipblocks - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.image - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.oldimage - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.recentchanges - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.watchlist - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; -GRANT SELECT ON `{$wgDBname}`.math - TO {$wgDBsqluser}@localhost.localdomain IDENTIFIED BY '{$wgDBsqlpassword}'; - diff --git a/maintenance/wikipedia-interwiki.sql b/maintenance/wikipedia-interwiki.sql index c42b47d8f6..77ab327b1c 100644 --- a/maintenance/wikipedia-interwiki.sql +++ b/maintenance/wikipedia-interwiki.sql @@ -1,7 +1,7 @@ -- For convenience, here are the *in-project* interwiki prefixes -- for Wikipedia. -REPLACE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES +REPLACE INTO /*$wgDBprefix*/interwiki (iw_prefix,iw_url,iw_local) VALUES ('w','http://www.wikipedia.org/wiki/$1',1), ('m','http://meta.wikipedia.org/wiki/$1',1), ('meta','http://meta.wikipedia.org/wiki/$1',1), diff --git a/maintenance/wiktionary-interwiki.sql b/maintenance/wiktionary-interwiki.sql index a2863a87cc..787962d5b7 100644 --- a/maintenance/wiktionary-interwiki.sql +++ b/maintenance/wiktionary-interwiki.sql @@ -1,7 +1,7 @@ -- For convenience, here are the *in-project* interwiki prefixes -- for Wikipedia. -REPLACE INTO interwiki (iw_prefix,iw_url,iw_local) VALUES +REPLACE INTO /*$wgDBprefix*/interwiki (iw_prefix,iw_url,iw_local) VALUES ('w','http://www.wikipedia.org/wiki/$1',1), ('m','http://meta.wikipedia.org/wiki/$1',1), ('meta','http://meta.wikipedia.org/wiki/$1',1), -- 2.20.1