Set $wgDBadminuser and $wgDBadminpassword to root when using the root
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Sep 2004 18:16:32 +0000 (18:16 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 1 Sep 2004 18:16:32 +0000 (18:16 +0000)
login so that certain db upgrade steps (eg convertLinks.inc) will not
try to use the unprivileges database account to do restructuring.

This fixes the problem with upgrading wikis created by the old
command-line installer dying at the link table conversion.

config/index.php

index 2a6567b..09a7b37 100644 (file)
@@ -372,8 +372,8 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                $wgCommandLineMode = false;
                chdir( ".." );
                eval($local);
-               $wgDBadminuser = $wgDBuser;
-               $wgDBadminpassword = $wgDBpassword;
+               $wgDBadminuser = "root";
+               $wgDBadminpassword = $conf->RootPW;
                $wgCommandLineMode = true;
                $wgUseDatabaseMessages = false; /* FIXME: For database failure */
                require_once( "includes/Setup.php" );
@@ -400,6 +400,8 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) {
                                } else {
                                        print "<li>Trying regular user...\n";
                                        /* Try the regular user... */
+                                       $wgDBadminuser = $wgDBuser;
+                                       $wgDBadminpassword = $wgDBpassword;
                                        $wgDatabase = Database::newFromParams( $wgDBserver, $wgDBuser, $wgDBpassword, "", 1 );
                                        $wgDatabase->isOpen();
                                        $wgDatabase->mIgnoreErrors = true;