diff --git a/core/includes/bootstrap.inc b/core/includes/bootstrap.inc
index e1c15fe..b503697 100644
--- a/core/includes/bootstrap.inc
+++ b/core/includes/bootstrap.inc
@@ -727,7 +727,7 @@ function drupal_settings_initialize() {
   global $base_url, $base_path, $base_root, $script_path;
 
   // Export these settings.php variables to the global namespace.
-  global $databases, $cookie_domain, $conf, $installed_profile, $db_prefix, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url, $config_directories;
+  global $cookie_domain, $conf, $installed_profile, $drupal_hash_salt, $is_https, $base_secure_url, $base_insecure_url, $config_directories;
   $conf = array();
 
   // Make conf_path() available as local variable in settings.php.
@@ -2302,7 +2302,8 @@ function _drupal_bootstrap_configuration() {
   // Redirect the user to the installation script if Drupal has not been
   // installed yet (i.e., if no $databases array has been defined in the
   // settings.php file) and we are not already installing.
-  if (empty($GLOBALS['databases']) && !drupal_installation_attempted()) {
+  $databases = settings()->get('databases');
+  if (empty($databases) && !drupal_installation_attempted()) {
     include_once DRUPAL_ROOT . '/core/includes/install.inc';
     install_goto('core/install.php');
   }
@@ -2379,7 +2380,8 @@ function _drupal_initialize_db_test_prefix() {
     $test_info['test_run_id'] = $test_prefix;
     $test_info['in_child_site'] = TRUE;
 
-    foreach ($GLOBALS['databases']['default'] as &$value) {
+    $default_databases = settings()->get('databases.default');
+    foreach ($default_databases as &$value) {
       // Extract the current default database prefix.
       if (!isset($value['prefix'])) {
         $current_prefix = '';
diff --git a/core/includes/common.inc b/core/includes/common.inc
index 60f57f2..3ad6ae4 100644
--- a/core/includes/common.inc
+++ b/core/includes/common.inc
@@ -4803,7 +4803,8 @@ function drupal_json_decode($var) {
  *   A salt based on information in settings.php, not in the database.
  */
 function drupal_get_hash_salt() {
-  global $drupal_hash_salt, $databases;
+  global $drupal_hash_salt;
+  $databases = settings()->get('databases');
   // If the $drupal_hash_salt variable is empty, a hash of the serialized
   // database credentials is used as a fallback salt.
   return empty($drupal_hash_salt) ? hash('sha256', serialize($databases)) : $drupal_hash_salt;
diff --git a/core/includes/install.core.inc b/core/includes/install.core.inc
index bf8ef66..e94fc90 100644
--- a/core/includes/install.core.inc
+++ b/core/includes/install.core.inc
@@ -1,5 +1,6 @@
 <?php
 
+use Drupal\Component\Utility\Settings;
 use Drupal\Core\DrupalKernel;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Install\TaskException;
@@ -415,7 +416,8 @@ function install_begin_request(&$install_state) {
     $task = NULL;
 
     // Do not install over a configured settings.php.
-    if (!empty($GLOBALS['databases'])) {
+    $databases = settings()->get('databases');
+    if (!empty($databases)) {
       throw new Exception(install_already_done_error());
     }
   }
@@ -947,7 +949,7 @@ function install_verify_completed_task() {
  * Verifies that settings.php specifies a valid database connection.
  */
 function install_verify_database_settings() {
-  global $databases;
+  $databases = settings()->get('databases');
   if (!empty($databases)) {
     $database = $databases['default']['default'];
     drupal_static_reset('conf_path');
@@ -971,7 +973,7 @@ function install_verify_database_settings() {
  * @ingroup forms
  */
 function install_settings_form($form, &$form_state, &$install_state) {
-  global $databases;
+  $databases = settings()->get('databases');
   $profile = $install_state['parameters']['profile'];
 
   drupal_static_reset('conf_path');
@@ -1060,7 +1062,6 @@ function install_settings_form_validate($form, &$form_state) {
  * Checks a database connection and returns any errors.
  */
 function install_database_errors($database, $settings_file) {
-  global $databases;
   $errors = array();
 
   // Check database type.
@@ -1075,7 +1076,9 @@ function install_database_errors($database, $settings_file) {
 
     // Run tasks associated with the database type. Any errors are caught in the
     // calling function.
-    $databases['default']['default'] = $database;
+    $settings = settings()->getAll();
+    $settings['databases']['default']['default'] = $database;;
+    new Settings($settings);
     // Just changing the global doesn't get the new information processed.
     // We need to close any active connections and tell the Database class to
     // re-parse $databases.
@@ -1106,7 +1109,7 @@ function install_settings_form_submit($form, &$form_state) {
   global $install_state;
 
   // Update global settings array and save.
-  $settings['databases'] = (object) array(
+  $settings['settings']['databases'] = (object) array(
     'value'    => array('default' => array('default' => $form_state['storage']['database'])),
     'required' => TRUE,
   );
diff --git a/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php
index a54c9cb..63f0044 100644
--- a/core/lib/Drupal/Core/Database/Database.php
+++ b/core/lib/Drupal/Core/Database/Database.php
@@ -209,7 +209,7 @@
    * Process the configuration file for database information.
    */
   final public static function parseConnectionInfo() {
-    global $databases;
+    $databases = settings()->get('databases');
 
     $database_info = is_array($databases) ? $databases : array();
     foreach ($database_info as $index => $info) {
diff --git a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
index 35af531..6c10ecc 100644
--- a/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
+++ b/core/modules/simpletest/lib/Drupal/simpletest/TestBase.php
@@ -812,14 +812,14 @@ protected function changeDatabasePrefix() {
     }
     Database::addConnectionInfo('default', 'default', $connection_info['default']);
 
-    // Additionally override global $databases, since the installer does not use
-    // the Database connection info.
+    // Additionally override the databases in the Settings singleton, since the
+    // installer does not use the Database connection info.
     // @see install_verify_database_settings()
     // @see install_database_errors()
     // @todo Fix installer to use Database connection info.
-    global $databases;
-    $databases['default']['default'] = $connection_info['default'];
-
+    $settings = settings()->getAll();
+    $settings['databases']['default']['default'] = $connection_info['default'];
+    new Settings($settings);
     // Indicate the database prefix was set up correctly.
     $this->setupDatabasePrefix = TRUE;
   }
@@ -1026,9 +1026,10 @@ protected function tearDown() {
     Database::removeConnection('default');
     Database::renameConnection('simpletest_original_default', 'default');
     // @see TestBase::changeDatabasePrefix()
-    global $databases;
+    $settings = settings()->getAll();
     $connection_info = Database::getConnectionInfo('default');
-    $databases['default']['default'] = $connection_info['default'];
+    $settings['databases']['default']['default'] = $connection_info['default'];
+    new Settings($settings);
 
     // Restore original globals.
     if (isset($this->originalThemeKey)) {
diff --git a/core/modules/system/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php
index 3bba870..1a673bc 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Database/ConnectionUnitTest.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\system\Tests\Database;
 
+use Drupal\Component\Utility\Settings;
 use Drupal\Core\Database\Database;
 use Drupal\simpletest\UnitTestBase;
 
@@ -52,8 +53,9 @@ function setUp() {
     // and closed in this test.
     // @see TestBase::changeDatabasePrefix()
     Database::addConnectionInfo('default', 'monitor', $connection_info['default']);
-    global $databases;
-    $databases['default']['monitor'] = $connection_info['default'];
+    $settings = settings()->getAll();
+    $settings['databases']['default']['monitor'] = $connection_info['default'];
+    new Settings($settings);
     $this->monitor = Database::getConnection('monitor');
   }
 
