Issue #2939026 by tstoeckler: Installer does not fix the database connection after creating the database on MySQL
parent
3fcf07947c
commit
a2d12696bf
|
@ -108,6 +108,16 @@ class Tasks extends InstallTasks {
|
||||||
// Now, attempt the connection again; if it's successful, attempt to
|
// Now, attempt the connection again; if it's successful, attempt to
|
||||||
// create the database.
|
// create the database.
|
||||||
Database::getConnection()->createDatabase($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) {
|
catch (DatabaseNotFoundException $e) {
|
||||||
// Still no dice; probably a permission issue. Raise the error to the
|
// Still no dice; probably a permission issue. Raise the error to the
|
||||||
|
|
Loading…
Reference in New Issue