Commit a2d12696 authored by alexpott's avatar alexpott

Issue #2939026 by tstoeckler: Installer does not fix the database connection...

Issue #2939026 by tstoeckler: Installer does not fix the database connection after creating the database on MySQL
parent 3fcf0794
......@@ -108,6 +108,16 @@ protected function connect() {
// 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment