Index: wp-includes/wp-db.php
===================================================================
--- wp-includes/wp-db.php	(revision 11216)
+++ wp-includes/wp-db.php	(working copy)
@@ -426,7 +426,18 @@
 	 * @return null Always null.
 	 */
 	function select($db) {
-		if (!@mysql_select_db($db, $this->dbh)) {
+		static $select_error = false;
+				
+		// if select fails, try to create the database
+		if ( !$select_error && !@mysql_select_db($db, $this->dbh) ) {			
+			$query = $this->prepare('CREATE DATABASE %s DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;', $db);
+			$this->query($query);
+			if ( !@mysql_select_db($db, $this->dbh) ) {
+				$select_error = true;
+			}			
+		}		
+		
+		if ( $select_error ) {
 			$this->ready = false;
 			$this->bail(sprintf(/*WP_I18N_DB_SELECT_DB*/'
 <h1>Can&#8217;t select database</h1>
