From 3c8ee5be32ae9457a2a221316ec076bfa0b6d9d2 Mon Sep 17 00:00:00 2001 From: Erik Moeller Date: Thu, 22 Jan 2004 04:49:05 +0000 Subject: [PATCH] nope - this is how it should work... --- AdminSettings.sample | 8 +++----- LocalSettings.sample | 9 ++++++--- install.php | 16 ++++++++-------- 3 files changed, 17 insertions(+), 16 deletions(-) diff --git a/AdminSettings.sample b/AdminSettings.sample index fd373e40d1..b7e85f6475 100644 --- a/AdminSettings.sample +++ b/AdminSettings.sample @@ -6,11 +6,9 @@ # # Developers: Do not check AdminSettings.php into CVS! -# This data is used to set up the database, and for all -# maintenance operations on it (rebuild links tables etc.). -# You can use the root account here. If you don't, make sure -# that the user has the rights to create the database before -# running the install script, or create the database yourself. +# This data is used for all maintenance operations. +# The user DOES NOT NEED TO EXIST. It is created by the +# installation script. $wgDBadminuser = "wikiadmin"; $wgDBadminpassword = "adminpass"; diff --git a/LocalSettings.sample b/LocalSettings.sample index 288a73f5b8..10d228c006 100644 --- a/LocalSettings.sample +++ b/LocalSettings.sample @@ -40,12 +40,15 @@ $wgEmergencyContact = "wikiadmin@myhost.com"; # MySQL settings # -# You should use a user with limited rights here, -# instead of the root account. +# The user you specify here DOES NOT NEED TO EXIST. +# It is created by the installation script. +# +# $wgDBsqluser is used for queries through the +# web interface. # $wgDBserver = "localhost"; -$wgDBuser = "wikiuser"; $wgDBname = "wikidb"; +$wgDBuser = "wikiuser"; $wgDBpassword = "userpass"; $wgDBsqluser = "sqluser"; $wgDBsqlpassword = "sqlpass"; diff --git a/install.php b/install.php index c74b684262..2d8db90da5 100644 --- a/install.php +++ b/install.php @@ -104,20 +104,20 @@ print "\n* * *\nWarning! This script will completely erase any\n" . $response = readconsole(); if ( ! ( "Y" == $response{0} || "y" == $response{0} ) ) { exit(); } -print "\nFor database access, we are using the data in AdminSettings.php.\n"; -print "If you get any error message, please make sure this information is correct\n"; -print "and you have the rights to create a database using the data provided.\n"; -print "(If you have already created the database, don't worry, the script will\n"; -print "simply skip that step.)\n\n"; - -global $wgDBadminuser, $wgDBadminpassword; +print "Please enter your root password for the database server now.\n"; +print "It is used to do the following:\n"; +print "1) Create the database\n"; +print "2) Create the users specified in AdminSettings.php and LocalSettings.php\n\n"; +print "You do not need to create any user accounts yourself!\n\n"; +print "MySQL root password (typing will be visible): "; +$rootpw=readconsole(); # Include rest of code to get things like internationalized messages. # include_once( "{$IP}/Setup.php" ); $wgTitle = Title::newFromText( "Installation script" ); -$wgDatabase = Database::newFromParams( $wgDBserver, $wgDBadminuser, $wgDBadminpassword, "", 1 ); +$wgDatabase = Database::newFromParams( $wgDBserver, "root", $rootpw, "", 1 ); if ( !$wgDatabase->isOpen() ) { print "Could not connect to database on \"{$wgDBserver}\" as root.\n"; exit(); -- 2.20.1