Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / lib / Drupal / Core / Database / Driver / mysql / Install / Tasks.php
index 0b1d7dde7d075479c8354e122d9bdd61e4d82a67..67f25269ab20395e5c709252768970aa12cb0e12 100644 (file)
@@ -108,6 +108,16 @@ class Tasks extends InstallTasks {
           // Now, attempt the connection again; if it's successful, attempt to
           // create the database.
           Database::getConnection()->createDatabase($database);
+          Database::closeConnection();
+
+          // Now, restore the database config.
+          Database::removeConnection('default');
+          $connection_info['default']['database'] = $database;
+          Database::addConnectionInfo('default', 'default', $connection_info['default']);
+
+          // Check the database connection.
+          Database::getConnection();
+          $this->pass('Drupal can CONNECT to the database ok.');
         }
         catch (DatabaseNotFoundException $e) {
           // Still no dice; probably a permission issue. Raise the error to the