### Eclipse Workspace Patch 1.0
#P 19stable
Index: install.php
===================================================================
RCS file: /cvsroot/moodle/moodle/install.php,v
retrieving revision 1.80
diff -u -r1.80 install.php
--- install.php	10 Oct 2007 11:03:00 -0000	1.80
+++ install.php	2 Dec 2007 07:48:00 -0000
@@ -351,9 +351,16 @@
             /// The following doesn't seem to work but we're working on it
             /// If you come up with a solution for creating a database in MySQL
             /// feel free to put it in and let us know
-            if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'])) {
+            if ($dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],'mysql')) {
                 switch ($INSTALL['dbtype']) {   /// Try to create a database
                     case 'mysql':
+                    if ($db->Execute("CREATE DATABASE {$INSTALL['dbname']} DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;")) {
+                            $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']);
+                        } else {
+                            $errormsg = get_string('dbcreationerror', 'install');
+                            $nextstage = DATABASE;
+                        }
+                        break;
                     case 'mysqli':
                         if ($db->Execute("CREATE DATABASE {$INSTALL['dbname']};")) {
                             $dbconnected = $db->Connect($INSTALL['dbhost'],$INSTALL['dbuser'],$INSTALL['dbpass'],$INSTALL['dbname']);
