Issue #2939026 by tstoeckler: Installer does not fix the database connection after creating the database on MySQL

merge-requests/1654/head
Alex Pott 2018-02-07 21:18:22 +00:00
parent 3fcf07947c
commit a2d12696bf
1 changed files with 10 additions and 0 deletions

View 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