Add basic support for table prefixes to the installer. (Probably will fail on upgrade...
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Dec 2004 13:15:13 +0000 (13:15 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Dec 2004 13:15:13 +0000 (13:15 +0000)
config/index.php
install-utils.inc
maintenance/InitialiseMessages.inc
maintenance/archives/patch-userlevels-defaultgroups.sql
maintenance/changeuser.sql
maintenance/interwiki.sql
maintenance/recount.sql
maintenance/tables.sql
maintenance/users.sql
maintenance/wikipedia-interwiki.sql
maintenance/wiktionary-interwiki.sql

index 67e8789..c5c65c5 100644 (file)
@@ -321,6 +321,7 @@ print "<li>Script URI path: <tt>" . htmlspecialchars( $conf->ScriptPath ) . "</t
        $conf->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.</li>\n";
 
                        print "<li>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 "<li>Granting user permissions...</li>\n";
@@ -539,32 +547,19 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                                print "<li>Skipped sysop account creation, no name given.</li>\n";
                        }
 
-                       print "<li>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 "</li>\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 "<li><pre>";
                        initialiseMessages();
@@ -767,6 +762,16 @@ if( count( $errs ) ) {
                you can specify new accounts/databases to be created.
        </dt>
 
+       <dd><?php
+               aField( $conf, "DBprefix", "Database table prefix" );
+       ?></dd>
+       <dt>
+               <p>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.</p>
+               
+               <p>Avoid exotic characters; something like <tt>mw_</tt> is good.</p>
+       </dt>
 
        <dd>
                <?php
@@ -914,6 +919,7 @@ if ( \$wgCommandLineMode ) {
 \$wgDBname           = \"{$slconf['DBname']}\";
 \$wgDBuser           = \"{$slconf['DBuser']}\";
 \$wgDBpassword       = \"{$slconf['DBpassword']}\";
+\$wgDBprefix         = \"{$slconf['DBprefix']}\";
 
 ## To allow SQL queries through the wiki's Special:Askaql page,
 ## uncomment the next lines. THIS IS VERY INSECURE. If you want
@@ -925,6 +931,7 @@ if ( \$wgCommandLineMode ) {
 # \$wgDBsqluser        = \"sqluser\";
 # \$wgDBsqlpassword    = \"sqlpass\";
 
+# If you're on MySQL 3.x, this next line must be FALSE:
 \$wgDBmysql4 = \$wgEnablePersistentLC = {$conf->DBmysql4};
 
 ## Shared memory settings
index 1fb2cc8..105818d 100644 (file)
@@ -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;
 }
index f3e3623..755ccdc 100755 (executable)
@@ -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...';
index 0871cdb..fac0476 100644 (file)
@@ -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');
index f6e5cf8..ad1c6da 100644 (file)
@@ -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;
 
index e625552..1b04ee9 100644 (file)
@@ -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),
index 93e1024..2bf4a7f 100644 (file)
@@ -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;
 
index db2c070..67596d7 100644 (file)
@@ -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)
index dc23ed3..4d74987 100644 (file)
@@ -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}';
-
index c42b47d..77ab327 100644 (file)
@@ -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),
index a2863a8..787962d 100644 (file)
@@ -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),