diff --git a/composer.lock b/composer.lock
index f7dba98f5d..24eb4d5ef8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -461,7 +461,7 @@
             "dist": {
                 "type": "path",
                 "url": "core",
-                "reference": "e3d324da27c1060f5f9982ee20aa7f9845303fd2"
+                "reference": "146e883eec01199575fbab55d9f4701448f0b97b"
             },
             "require": {
                 "asm89/stack-cors": "^1.1",
@@ -674,9 +674,6 @@
                     "lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php",
                     "lib/Drupal/Core/Database/Connection.php",
                     "lib/Drupal/Core/Database/Database.php",
-                    "lib/Drupal/Core/Database/Driver/mysql/Connection.php",
-                    "lib/Drupal/Core/Database/Driver/pgsql/Connection.php",
-                    "lib/Drupal/Core/Database/Driver/sqlite/Connection.php",
                     "lib/Drupal/Core/Database/Statement.php",
                     "lib/Drupal/Core/Database/StatementInterface.php",
                     "lib/Drupal/Core/DependencyInjection/Container.php",
diff --git a/core/assets/scaffold/files/default.settings.php b/core/assets/scaffold/files/default.settings.php
index 76e509abeb..c1e0764b46 100644
--- a/core/assets/scaffold/files/default.settings.php
+++ b/core/assets/scaffold/files/default.settings.php
@@ -203,9 +203,9 @@
  * information on these defaults and the potential issues.
  *
  * More details can be found in the constructor methods for each driver:
- * - \Drupal\Core\Database\Driver\mysql\Connection::__construct()
- * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct()
- * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
+ * - \Drupal\mysql\Driver\Database\mysql\Connection::__construct()
+ * - \Drupal\pgsql\Driver\Database\pgsql\Connection::__construct()
+ * - \Drupal\sqlite\Driver\Database\sqlite\Connection::__construct()
  *
  * Sample Database configuration format for PostgreSQL (pgsql):
  * @code
diff --git a/core/composer.json b/core/composer.json
index cf64c7800f..30ee06267d 100644
--- a/core/composer.json
+++ b/core/composer.json
@@ -130,11 +130,13 @@
         "drupal/migrate_drupal": "self.version",
         "drupal/migrate_drupal_multilingual": "self.version",
         "drupal/migrate_drupal_ui": "self.version",
+        "drupal/mysql": "self.version",
         "drupal/node": "self.version",
         "drupal/options": "self.version",
         "drupal/page_cache": "self.version",
         "drupal/path": "self.version",
         "drupal/path_alias": "self.version",
+        "drupal/pgsql": "self.version",
         "drupal/quickedit": "self.version",
         "drupal/rdf": "self.version",
         "drupal/responsive_image": "self.version",
@@ -144,6 +146,7 @@
         "drupal/settings_tray": "self.version",
         "drupal/seven": "self.version",
         "drupal/shortcut": "self.version",
+        "drupal/sqlite": "self.version",
         "drupal/standard": "self.version",
         "drupal/stark": "self.version",
         "drupal/statistics": "self.version",
@@ -186,9 +189,6 @@
             "lib/Drupal/Core/Cache/DatabaseCacheTagsChecksum.php",
             "lib/Drupal/Core/Database/Connection.php",
             "lib/Drupal/Core/Database/Database.php",
-            "lib/Drupal/Core/Database/Driver/mysql/Connection.php",
-            "lib/Drupal/Core/Database/Driver/pgsql/Connection.php",
-            "lib/Drupal/Core/Database/Driver/sqlite/Connection.php",
             "lib/Drupal/Core/Database/Statement.php",
             "lib/Drupal/Core/Database/StatementInterface.php",
             "lib/Drupal/Core/DependencyInjection/Container.php",
diff --git a/core/includes/install.inc b/core/includes/install.inc
index e806a09a41..0ec7b7f4aa 100644
--- a/core/includes/install.inc
+++ b/core/includes/install.inc
@@ -173,7 +173,7 @@ function drupal_get_database_types() {
   // Find drivers in the Drupal\Core and Drupal\Driver namespaces.
   /** @var \Drupal\Core\File\FileSystemInterface $file_system */
   $file_system = \Drupal::service('file_system');
-  $files = $file_system->scanDirectory(DRUPAL_ROOT . '/core/lib/Drupal/Core/Database/Driver', $mask, ['recurse' => FALSE]);
+  $files = [];
   if (is_dir(DRUPAL_ROOT . '/drivers/lib/Drupal/Driver/Database')) {
     $files += $file_system->scanDirectory(DRUPAL_ROOT . '/drivers/lib/Drupal/Driver/Database/', $mask, ['recurse' => FALSE]);
   }
diff --git a/core/lib/Drupal/Core/Command/DbDumpCommand.php b/core/lib/Drupal/Core/Command/DbDumpCommand.php
index ae07e3f32f..c003887c96 100644
--- a/core/lib/Drupal/Core/Command/DbDumpCommand.php
+++ b/core/lib/Drupal/Core/Command/DbDumpCommand.php
@@ -265,7 +265,7 @@ protected function getTableIndexes(Connection $connection, $table, &$definition)
    */
   protected function getTableCollation(Connection $connection, $table, &$definition) {
     // Remove identifier quotes from the table name. See
-    // \Drupal\Core\Database\Driver\mysql\Connection::$identifierQuotes.
+    // \Drupal\mysql\Driver\Database\mysql\Connection::$identifierQuotes.
     $table = trim($connection->prefixTables('{' . $table . '}'), '"');
     $query = $connection->query("SHOW TABLE STATUS WHERE NAME = :table_name", [':table_name' => $table]);
     $data = $query->fetchAssoc();
diff --git a/core/lib/Drupal/Core/Database/Database.php b/core/lib/Drupal/Core/Database/Database.php
index 719dd29c4d..875bac30f9 100644
--- a/core/lib/Drupal/Core/Database/Database.php
+++ b/core/lib/Drupal/Core/Database/Database.php
@@ -229,9 +229,9 @@
       ];
     }
 
-    // Fallback for Drupal 7 settings.php if namespace is not provided.
+    // Fallback for Drupal 7 settings.php when the namespace is not provided.
     if (empty($info['namespace'])) {
-      $info['namespace'] = 'Drupal\\Core\\Database\\Driver\\' . $info['driver'];
+      $info['namespace'] = 'Drupal\\' . $info['driver'] . '\\Driver\\Database\\' . $info['driver'];
     }
 
     return $info;
@@ -472,6 +472,21 @@ public static function convertDbUrlToConnectionInfo($url, $root) {
     $module = NULL;
     $connection_class = NULL;
     $url_components = parse_url($url);
+
+    // Add the module key for the by core supported database drivers when the
+    // module key is not set.
+    if (in_array($driver, ['mysql', 'pgsql', 'sqlite'], TRUE)) {
+      if (isset($url_components['query'])) {
+        parse_str($url_components['query'], $query);
+        if (!isset($query['module'])) {
+          $url_components['query'] .= '&module=' . $driver;
+        }
+      }
+      else {
+        $url_components['query'] = 'module=' . $driver;
+      }
+    }
+
     if (isset($url_components['query'])) {
       parse_str($url_components['query'], $query);
       if (isset($query['module']) && $query['module']) {
@@ -484,23 +499,18 @@ public static function convertDbUrlToConnectionInfo($url, $root) {
         $additional_class_loader = new ClassLoader();
         $additional_class_loader->addPsr4($namespace . '\\', $psr4_base_directory);
         $additional_class_loader->register(TRUE);
-        $connection_class = $custom_connection_class = $namespace . '\\Connection';
+        $connection_class = $namespace . '\\Connection';
       }
     }
 
     if (!$module) {
       // Determine the connection class to use. Discover if the URL has a valid
-      // driver scheme. Try with Drupal 8 style custom drivers first, since
-      // those can override/extend the core ones.
-      $connection_class = $custom_connection_class = "Drupal\\Driver\\Database\\{$driver}\\Connection";
-      if (!class_exists($connection_class)) {
-        // If the URL is not relative to a custom driver, try with core ones.
-        $connection_class = "Drupal\\Core\\Database\\Driver\\{$driver}\\Connection";
-      }
+      // driver scheme for a Drupal 8 style custom driver.
+      $connection_class = "Drupal\\Driver\\Database\\{$driver}\\Connection";
     }
 
     if (!class_exists($connection_class)) {
-      throw new \InvalidArgumentException("Can not convert '$url' to a database connection, class '$custom_connection_class' does not exist");
+      throw new \InvalidArgumentException("Can not convert '$url' to a database connection, class '$connection_class' does not exist");
     }
 
     $options = $connection_class::createConnectionOptionsFromUrl($url, $root);
@@ -645,8 +655,8 @@ protected static function getDatabaseDriverNamespace(array $connection_info) {
     if (isset($connection_info['namespace'])) {
       return $connection_info['namespace'];
     }
-    // Fallback for Drupal 7 settings.php.
-    return 'Drupal\\Core\\Database\\Driver\\' . $connection_info['driver'];
+    // Fallback for Drupal 7 settings.php when the namespace is not provided.
+    return 'Drupal\\' . $connection_info['driver'] . '\\Driver\\Database\\' . $connection_info['driver'];
   }
 
   /**
diff --git a/core/lib/Drupal/Core/Database/StatementInterface.php b/core/lib/Drupal/Core/Database/StatementInterface.php
index 4f4248df04..49325dddc1 100644
--- a/core/lib/Drupal/Core/Database/StatementInterface.php
+++ b/core/lib/Drupal/Core/Database/StatementInterface.php
@@ -7,13 +7,13 @@
  *
  * Child implementations should either extend PDOStatement:
  * @code
- * class Drupal\Core\Database\Driver\oracle\Statement extends PDOStatement implements Drupal\Core\Database\StatementInterface {}
+ * class Drupal\oracle\Driver\Database\oracle\Statement extends PDOStatement implements Drupal\Core\Database\StatementInterface {}
  * @endcode
  * or define their own class. If defining their own class, they will also have
  * to implement either the Iterator or IteratorAggregate interface before
  * Drupal\Core\Database\StatementInterface:
  * @code
- * class Drupal\Core\Database\Driver\oracle\Statement implements Iterator, Drupal\Core\Database\StatementInterface {}
+ * class Drupal\oracle\Driver\Database\oracle\Statement implements Iterator, Drupal\Core\Database\StatementInterface {}
  * @endcode
  *
  * @ingroup database
diff --git a/core/lib/Drupal/Core/Database/StatementPrefetch.php b/core/lib/Drupal/Core/Database/StatementPrefetch.php
index 4294b72d26..2da834f461 100644
--- a/core/lib/Drupal/Core/Database/StatementPrefetch.php
+++ b/core/lib/Drupal/Core/Database/StatementPrefetch.php
@@ -172,7 +172,7 @@ public function execute($args = [], $options = []) {
     // as soon as possible.
     $this->data = $statement->fetchAll(\PDO::FETCH_ASSOC);
     // Destroy the statement as soon as possible. See the documentation of
-    // \Drupal\Core\Database\Driver\sqlite\Statement for an explanation.
+    // \Drupal\sqlite\Driver\Database\sqlite\Statement for an explanation.
     unset($statement);
 
     $this->resultRowCount = count($this->data);
diff --git a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
index a10af1e48c..bc8d42afc3 100644
--- a/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
+++ b/core/lib/Drupal/Core/Test/FunctionalTestSetupTrait.php
@@ -507,6 +507,7 @@ protected function installParameters() {
     $connection_info['default']['prefix'] = $connection_info['default']['prefix']['default'];
     unset($connection_info['default']['driver']);
     unset($connection_info['default']['namespace']);
+    unset($connection_info['default']['autoload']);
     unset($connection_info['default']['pdo']);
     unset($connection_info['default']['init_commands']);
     // Remove database connection info that is not used by SQLite.
diff --git a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
index 7b2093c8bc..c10ab707ee 100644
--- a/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
+++ b/core/modules/comment/tests/src/Unit/CommentStatisticsUnitTest.php
@@ -51,7 +51,7 @@ class CommentStatisticsUnitTest extends UnitTestCase {
    * Sets up required mocks and the CommentStatistics service under test.
    */
   protected function setUp(): void {
-    $this->statement = $this->getMockBuilder('Drupal\Core\Database\Driver\sqlite\Statement')
+    $this->statement = $this->getMockBuilder('Drupal\sqlite\Driver\Database\sqlite\Statement')
       ->disableOriginalConstructor()
       ->getMock();
 
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
index d7058b1a7d..fe59d8a2de 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateSqlSourceTestBase.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\migrate\Kernel;
 
-use Drupal\Core\Database\Driver\sqlite\Connection;
+use Drupal\sqlite\Driver\Database\sqlite\Connection;
 
 /**
  * Base class for tests of Migrate source plugins that use a database.
@@ -16,7 +16,7 @@
    *   The source data, keyed by table name. Each table is an array containing
    *   the rows in that table.
    *
-   * @return \Drupal\Core\Database\Driver\sqlite\Connection
+   * @return \Drupal\sqlite\Driver\Database\sqlite\Connection
    *   The SQLite database connection.
    */
   protected function getDatabase(array $source_data) {
diff --git a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
index 8fcef4a60e..e8d671e11f 100644
--- a/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
+++ b/core/modules/migrate/tests/src/Kernel/MigrateTestBase.php
@@ -96,7 +96,7 @@ private function createMigrationConnection() {
       $connection_info[$target]['prefix']['default'] = $prefix . '0';
 
       // Add the original simpletest prefix so SQLite can attach its database.
-      // @see \Drupal\Core\Database\Driver\sqlite\Connection::init()
+      // @see \Drupal\sqlite\Driver\Database\sqlite\Connection::init()
       $connection_info[$target]['prefix'][$value['prefix']['default']] = $value['prefix']['default'];
     }
     Database::addConnectionInfo('migrate', 'default', $connection_info['default']);
diff --git a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
index 10ed8755cf..1af9f3d71c 100644
--- a/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
+++ b/core/modules/migrate/tests/src/Kernel/Plugin/MigrationPluginListTest.php
@@ -141,7 +141,7 @@ public function testGetDefinitions() {
       $connection_info[$target]['prefix']['default'] = $prefix . '0';
 
       // Add the original simpletest prefix so SQLite can attach its database.
-      // @see \Drupal\Core\Database\Driver\sqlite\Connection::init()
+      // @see \Drupal\sqlite\Driver\Database\sqlite\Connection::init()
       $connection_info[$target]['prefix'][$value['prefix']['default']] = $value['prefix']['default'];
     }
     Database::addConnectionInfo('migrate', 'default', $connection_info['default']);
diff --git a/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php b/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
index 86dd2059dc..8255c7c15c 100644
--- a/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
+++ b/core/modules/migrate/tests/src/Kernel/QueryBatchTest.php
@@ -6,7 +6,7 @@
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\Plugin\MigrateIdMapInterface;
 use Drupal\migrate\Plugin\MigrationInterface;
-use Drupal\Core\Database\Driver\sqlite\Connection;
+use Drupal\sqlite\Driver\Database\sqlite\Connection;
 
 /**
  * Tests query batching.
@@ -224,7 +224,7 @@ protected function getPlugin($configuration) {
    *   The source data, keyed by table name. Each table is an array containing
    *   the rows in that table.
    *
-   * @return \Drupal\Core\Database\Driver\sqlite\Connection
+   * @return \Drupal\sqlite\Driver\Database\sqlite\Connection
    *   The SQLite database connection.
    */
   protected function getDatabase(array $source_data) {
diff --git a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
index ae135932f9..ab2f0c16b2 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateSqlIdMapTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
-use Drupal\Core\Database\Driver\sqlite\Connection;
+use Drupal\sqlite\Driver\Database\sqlite\Connection;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\migrate\MigrateException;
 use Drupal\migrate\Plugin\MigrateIdMapInterface;
@@ -962,7 +962,7 @@ public function testGetQualifiedMapTablePrefix() {
     $qualified_map_table = $this->getIdMap()->getQualifiedMapTableName();
     // The SQLite driver is a special flower. It will prefix tables with
     // PREFIX.TABLE, instead of the standard PREFIXTABLE.
-    // @see \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
+    // @see \Drupal\sqlite\Driver\Database\sqlite\Connection::__construct()
     $this->assertEquals('prefix.migrate_map_sql_idmap_test', $qualified_map_table);
   }
 
diff --git a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
index 4cb14415bb..aef0d302ba 100644
--- a/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
+++ b/core/modules/migrate/tests/src/Unit/MigrateTestCase.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\migrate\Unit;
 
-use Drupal\Core\Database\Driver\sqlite\Connection;
+use Drupal\sqlite\Driver\Database\sqlite\Connection;
 use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\migrate\Plugin\MigrationInterface;
 use Drupal\Tests\UnitTestCase;
@@ -99,7 +99,7 @@ protected function getMigration() {
    *   (optional) Options for the database connection. Defaults to an empty
    *   array.
    *
-   * @return \Drupal\Core\Database\Driver\sqlite\Connection
+   * @return \Drupal\sqlite\Driver\Database\sqlite\Connection
    *   The database connection.
    */
   protected function getDatabase(array $database_contents, $connection_options = []) {
diff --git a/core/modules/mysql/mysql.info.yml b/core/modules/mysql/mysql.info.yml
new file mode 100644
index 0000000000..bb0d29feee
--- /dev/null
+++ b/core/modules/mysql/mysql.info.yml
@@ -0,0 +1,6 @@
+name: MySQL
+type: module
+description: 'Database driver for MySQL.'
+package: Core
+version: VERSION
+hidden: true
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/modules/mysql/src/Driver/Database/mysql/Connection.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
rename to core/modules/mysql/src/Driver/Database/mysql/Connection.php
index bd9e9a7791..74ee140052 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Connection.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\DatabaseAccessDeniedException;
 use Drupal\Core\Database\DatabaseExceptionWrapper;
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php b/core/modules/mysql/src/Driver/Database/mysql/Delete.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
rename to core/modules/mysql/src/Driver/Database/mysql/Delete.php
index 0ff1155781..91aa780b9e 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Delete.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Delete.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Delete as QueryDelete;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Insert.php b/core/modules/mysql/src/Driver/Database/mysql/Insert.php
similarity index 97%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Insert.php
rename to core/modules/mysql/src/Driver/Database/mysql/Insert.php
index c65642aed0..6169852103 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Insert.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Insert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Insert as QueryInsert;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php b/core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php
similarity index 97%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php
rename to core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php
index 833bce7507..2b420b8cc1 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Install/Tasks.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Install/Tasks.php
@@ -1,11 +1,11 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql\Install;
+namespace Drupal\mysql\Driver\Database\mysql\Install;
 
 use Drupal\Core\Database\ConnectionNotDefinedException;
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Install\Tasks as InstallTasks;
-use Drupal\Core\Database\Driver\mysql\Connection;
+use Drupal\mysql\Driver\Database\mysql\Connection;
 use Drupal\Core\Database\DatabaseNotFoundException;
 
 /**
@@ -47,7 +47,7 @@ class Tasks extends InstallTasks {
   protected $pdoDriver = 'mysql';
 
   /**
-   * Constructs a \Drupal\Core\Database\Driver\mysql\Install\Tasks object.
+   * Constructs a \Drupal\mysql\Driver\Database\mysql\Install\Tasks object.
    */
   public function __construct() {
     $this->tasks[] = [
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php b/core/modules/mysql/src/Driver/Database/mysql/Merge.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
rename to core/modules/mysql/src/Driver/Database/mysql/Merge.php
index 06557e69c1..5f14de44b0 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Merge.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Merge.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Merge as QueryMerge;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php b/core/modules/mysql/src/Driver/Database/mysql/Schema.php
similarity index 98%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
rename to core/modules/mysql/src/Driver/Database/mysql/Schema.php
index d909f7c50b..63fd660e82 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Schema.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Schema.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\SchemaException;
 use Drupal\Core\Database\SchemaObjectExistsException;
@@ -123,7 +123,7 @@ protected function createTableSql($name, $table) {
     // 'utf8mb4_general_ci' (MySQL 5) or 'utf8mb4_0900_ai_ci' (MySQL 8) for
     // utf8mb4. If an alternate collation has been set, it needs to be
     // explicitly specified.
-    // @see \Drupal\Core\Database\Driver\mysql\Schema
+    // @see \Drupal\mysql\Driver\Database\mysql\Schema
     if (!empty($info['collation'])) {
       $sql .= ' COLLATE ' . $info['collation'];
     }
@@ -345,8 +345,8 @@ protected function getNormalizedIndexes(array $spec) {
    * @param array $index
    *   The index array to be used in createKeySql.
    *
-   * @see Drupal\Core\Database\Driver\mysql\Schema::createKeySql()
-   * @see Drupal\Core\Database\Driver\mysql\Schema::normalizeIndexes()
+   * @see Drupal\mysql\Driver\Database\mysql\Schema::createKeySql()
+   * @see Drupal\mysql\Driver\Database\mysql\Schema::normalizeIndexes()
    */
   protected function shortenIndex(&$index) {
     if (is_array($index)) {
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Select.php b/core/modules/mysql/src/Driver/Database/mysql/Select.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Select.php
rename to core/modules/mysql/src/Driver/Database/mysql/Select.php
index 610a016ad3..b8bb1bcf56 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Select.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Select.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Select as QuerySelect;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php b/core/modules/mysql/src/Driver/Database/mysql/Transaction.php
similarity index 80%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
rename to core/modules/mysql/src/Driver/Database/mysql/Transaction.php
index 6713281f1d..166613b785 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Transaction.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Transaction.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Transaction as DatabaseTransaction;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php b/core/modules/mysql/src/Driver/Database/mysql/Truncate.php
similarity index 79%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
rename to core/modules/mysql/src/Driver/Database/mysql/Truncate.php
index ce21021d23..fad3bc61da 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Truncate.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Truncate.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Truncate as QueryTruncate;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Update.php b/core/modules/mysql/src/Driver/Database/mysql/Update.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Update.php
rename to core/modules/mysql/src/Driver/Database/mysql/Update.php
index 529a7db19b..75ec29a162 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Update.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Update.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Update as QueryUpdate;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php b/core/modules/mysql/src/Driver/Database/mysql/Upsert.php
similarity index 96%
rename from core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php
rename to core/modules/mysql/src/Driver/Database/mysql/Upsert.php
index 8eda775c0a..0e5f7d3b50 100644
--- a/core/lib/Drupal/Core/Database/Driver/mysql/Upsert.php
+++ b/core/modules/mysql/src/Driver/Database/mysql/Upsert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\mysql;
+namespace Drupal\mysql\Driver\Database\mysql;
 
 use Drupal\Core\Database\Query\Upsert as QueryUpsert;
 
diff --git a/core/modules/pgsql/pgsql.info.yml b/core/modules/pgsql/pgsql.info.yml
new file mode 100644
index 0000000000..c2da05e85a
--- /dev/null
+++ b/core/modules/pgsql/pgsql.info.yml
@@ -0,0 +1,6 @@
+name: PostgreSQL
+type: module
+description: 'Database driver for PostgreSQL.'
+package: Core
+version: VERSION
+hidden: true
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/modules/pgsql/src/Driver/Database/pgsql/Connection.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Connection.php
index c2aef48a0f..21b14fc40d 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Connection.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Connection as DatabaseConnection;
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php b/core/modules/pgsql/src/Driver/Database/pgsql/Delete.php
similarity index 91%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Delete.php
index 2cf178e7b2..9585a9c4bc 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Delete.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Delete.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Query\Delete as QueryDelete;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php b/core/modules/pgsql/src/Driver/Database/pgsql/Insert.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Insert.php
index ce25e647f6..f66b087f68 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Insert.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Insert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Query\Insert as QueryInsert;
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php b/core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php
similarity index 98%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php
index 6e184aea2f..9e532abf34 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Install/Tasks.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Install/Tasks.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql\Install;
+namespace Drupal\pgsql\Driver\Database\pgsql\Install;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Install\Tasks as InstallTasks;
@@ -26,7 +26,7 @@ class Tasks extends InstallTasks {
   protected $pdoDriver = 'pgsql';
 
   /**
-   * Constructs a \Drupal\Core\Database\Driver\pgsql\Install\Tasks object.
+   * Constructs a \Drupal\pgsql\Driver\Database\pgsql\Install\Tasks object.
    */
   public function __construct() {
     $this->tasks[] = [
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Merge.php b/core/modules/pgsql/src/Driver/Database/pgsql/Merge.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Merge.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Merge.php
index a795821c3c..b0df214d95 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Merge.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Merge.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Query\Merge as QueryMerge;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php b/core/modules/pgsql/src/Driver/Database/pgsql/NativeUpsert.php
similarity index 98%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/NativeUpsert.php
index 03f9db0ddf..8d9d9586bb 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/NativeUpsert.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/NativeUpsert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Query\Upsert as QueryUpsert;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php b/core/modules/pgsql/src/Driver/Database/pgsql/Schema.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Schema.php
index cb4ac71626..c64364a809 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Schema.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Schema.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\SchemaObjectExistsException;
 use Drupal\Core\Database\SchemaObjectDoesNotExistException;
@@ -22,7 +22,7 @@ class Schema extends DatabaseSchema {
    * This is collected by Schema::queryTableInformation(), by introspecting the
    * database.
    *
-   * @see \Drupal\Core\Database\Driver\pgsql\Schema::queryTableInformation()
+   * @see \Drupal\pgsql\Driver\Database\pgsql\Schema::queryTableInformation()
    * @var array
    */
   protected $tableInformation = [];
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php b/core/modules/pgsql/src/Driver/Database/pgsql/Select.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Select.php
index 2df730d613..e8bbeeecf3 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Select.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Select.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Query\Select as QuerySelect;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Transaction.php b/core/modules/pgsql/src/Driver/Database/pgsql/Transaction.php
similarity index 80%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Transaction.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Transaction.php
index 138cbe6791..5dacde8ff4 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Transaction.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Transaction.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Transaction as DatabaseTransaction;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php b/core/modules/pgsql/src/Driver/Database/pgsql/Truncate.php
similarity index 91%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Truncate.php
index 0d9947b96f..18115e0a7d 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Truncate.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Truncate.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Query\Truncate as QueryTruncate;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Update.php b/core/modules/pgsql/src/Driver/Database/pgsql/Update.php
similarity index 98%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Update.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Update.php
index e937f6c8ea..0f085cf044 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Update.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Update.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\Query\Update as QueryUpdate;
diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Upsert.php b/core/modules/pgsql/src/Driver/Database/pgsql/Upsert.php
similarity index 98%
rename from core/lib/Drupal/Core/Database/Driver/pgsql/Upsert.php
rename to core/modules/pgsql/src/Driver/Database/pgsql/Upsert.php
index 52e077a179..f0ff5f2dd5 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Upsert.php
+++ b/core/modules/pgsql/src/Driver/Database/pgsql/Upsert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\pgsql;
+namespace Drupal\pgsql\Driver\Database\pgsql;
 
 use Drupal\Core\Database\Query\Upsert as QueryUpsert;
 
diff --git a/core/modules/sqlite/sqlite.info.yml b/core/modules/sqlite/sqlite.info.yml
new file mode 100644
index 0000000000..89a052937a
--- /dev/null
+++ b/core/modules/sqlite/sqlite.info.yml
@@ -0,0 +1,6 @@
+name: SQLite
+type: module
+description: 'Database driver for SQLite.'
+package: Core
+version: VERSION
+hidden: true
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/modules/sqlite/src/Driver/Database/sqlite/Connection.php
similarity index 98%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Connection.php
index f00ffb75ff..6e1bd0efd9 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Connection.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Database;
 use Drupal\Core\Database\DatabaseNotFoundException;
@@ -66,7 +66,7 @@ class Connection extends DatabaseConnection {
   protected $identifierQuotes = ['"', '"'];
 
   /**
-   * Constructs a \Drupal\Core\Database\Driver\sqlite\Connection object.
+   * Constructs a \Drupal\sqlite\Driver\Database\sqlite\Connection object.
    */
   public function __construct(\PDO $connection, array $connection_options) {
     // We don't need a specific PDOStatement class here, we simulate it in
@@ -206,7 +206,7 @@ public function __destruct() {
    * @return array
    *   An array of attached database names.
    *
-   * @see \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
+   * @see \Drupal\sqlite\Driver\Database\sqlite\Connection::__construct()
    */
   public function getAttachedDatabases() {
     return $this->attachedDatabases;
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php b/core/modules/sqlite/src/Driver/Database/sqlite/Delete.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Delete.php
index c009fb8105..aec5b4f4f7 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Delete.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Delete.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Delete as QueryDelete;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php b/core/modules/sqlite/src/Driver/Database/sqlite/Insert.php
similarity index 97%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Insert.php
index 4273dd6536..d1cc245e27 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Insert.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Insert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Insert as QueryInsert;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php b/core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php
similarity index 97%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php
index 81bdea39bb..21dd87081a 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Install/Tasks.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Install/Tasks.php
@@ -1,9 +1,9 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite\Install;
+namespace Drupal\sqlite\Driver\Database\sqlite\Install;
 
 use Drupal\Core\Database\Database;
-use Drupal\Core\Database\Driver\sqlite\Connection;
+use Drupal\sqlite\Driver\Database\sqlite\Connection;
 use Drupal\Core\Database\DatabaseNotFoundException;
 use Drupal\Core\Database\Install\Tasks as InstallTasks;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php b/core/modules/sqlite/src/Driver/Database/sqlite/Merge.php
similarity index 77%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Merge.php
index fddee0053b..bb9881663b 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Merge.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Merge.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Merge as QueryMerge;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php b/core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
index 2286aedbba..e5493a00d0 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Schema.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Schema.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\SchemaObjectExistsException;
 use Drupal\Core\Database\SchemaObjectDoesNotExistException;
@@ -561,7 +561,7 @@ public function dropField($table, $field) {
 
     // Drop the primary key if the field to drop is part of it. This is
     // consistent with the behavior on PostgreSQL.
-    // @see \Drupal\Core\Database\Driver\mysql\Schema::dropField()
+    // @see \Drupal\mysql\Driver\Database\mysql\Schema::dropField()
     if (isset($new_schema['primary key']) && in_array($field, $new_schema['primary key'], TRUE)) {
       unset($new_schema['primary key']);
     }
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php b/core/modules/sqlite/src/Driver/Database/sqlite/Select.php
similarity index 86%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Select.php
index 5eaa5157d8..5ee521af8b 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Select.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Select.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Select as QuerySelect;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php b/core/modules/sqlite/src/Driver/Database/sqlite/Statement.php
similarity index 99%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Statement.php
index d9b422b584..475ea690c7 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Statement.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Statement.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\StatementPrefetch;
 use Drupal\Core\Database\StatementInterface;
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php b/core/modules/sqlite/src/Driver/Database/sqlite/Transaction.php
similarity index 79%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Transaction.php
index aa1355147c..7a591a28d1 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Transaction.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Transaction.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Transaction as DatabaseTransaction;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php b/core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php
similarity index 92%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php
index 386912f878..f1535fb019 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Truncate.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Truncate.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Truncate as QueryTruncate;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php b/core/modules/sqlite/src/Driver/Database/sqlite/Update.php
similarity index 78%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Update.php
index 66a7294d49..2d9e3beb02 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Update.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Update.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Update as QueryUpdate;
 
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Upsert.php b/core/modules/sqlite/src/Driver/Database/sqlite/Upsert.php
similarity index 95%
rename from core/lib/Drupal/Core/Database/Driver/sqlite/Upsert.php
rename to core/modules/sqlite/src/Driver/Database/sqlite/Upsert.php
index ed9a021533..2a6183e71a 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Upsert.php
+++ b/core/modules/sqlite/src/Driver/Database/sqlite/Upsert.php
@@ -1,6 +1,6 @@
 <?php
 
-namespace Drupal\Core\Database\Driver\sqlite;
+namespace Drupal\sqlite\Driver\Database\sqlite;
 
 use Drupal\Core\Database\Query\Upsert as QueryUpsert;
 
diff --git a/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Connection.php b/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Connection.php
index dc5dab25ac..caa9694009 100644
--- a/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Connection.php
+++ b/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Connection.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\database_statement_monitoring_test\mysql;
 
-use Drupal\Core\Database\Driver\mysql\Connection as BaseConnection;
+use Drupal\mysql\Driver\Database\mysql\Connection as BaseConnection;
 use Drupal\database_statement_monitoring_test\LoggedStatementsTrait;
 
 /**
diff --git a/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Install/Tasks.php b/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Install/Tasks.php
index 443072d474..338e136cd5 100644
--- a/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Install/Tasks.php
+++ b/core/modules/system/tests/modules/database_statement_monitoring_test/src/mysql/Install/Tasks.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\database_statement_monitoring_test\mysql\Install;
 
-use Drupal\Core\Database\Driver\mysql\Install\Tasks as BaseTasks;
+use Drupal\mysql\Driver\Database\mysql\Install\Tasks as BaseTasks;
 
 class Tasks extends BaseTasks {
 }
diff --git a/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Connection.php b/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Connection.php
index 86f004e916..43995d325a 100644
--- a/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Connection.php
+++ b/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Connection.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\database_statement_monitoring_test\pgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Connection as BaseConnection;
+use Drupal\pgsql\Driver\Database\pgsql\Connection as BaseConnection;
 use Drupal\database_statement_monitoring_test\LoggedStatementsTrait;
 
 /**
diff --git a/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Install/Tasks.php b/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Install/Tasks.php
index c51bb2541a..0b95ddf53d 100644
--- a/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Install/Tasks.php
+++ b/core/modules/system/tests/modules/database_statement_monitoring_test/src/pgsql/Install/Tasks.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\database_statement_monitoring_test\pgsql\Install;
 
-use Drupal\Core\Database\Driver\pgsql\Install\Tasks as BaseTasks;
+use Drupal\pgsql\Driver\Database\pgsql\Install\Tasks as BaseTasks;
 
 class Tasks extends BaseTasks {
 }
diff --git a/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Connection.php b/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Connection.php
index fea32d6798..2b4201a976 100644
--- a/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Connection.php
+++ b/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Connection.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\database_statement_monitoring_test\sqlite;
 
-use Drupal\Core\Database\Driver\sqlite\Connection as BaseConnection;
+use Drupal\sqlite\Driver\Database\sqlite\Connection as BaseConnection;
 use Drupal\database_statement_monitoring_test\LoggedStatementsTrait;
 
 /**
diff --git a/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Install/Tasks.php b/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Install/Tasks.php
index 41d5962fef..4827f8c18b 100644
--- a/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Install/Tasks.php
+++ b/core/modules/system/tests/modules/database_statement_monitoring_test/src/sqlite/Install/Tasks.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\database_statement_monitoring_test\sqlite\Install;
 
-use Drupal\Core\Database\Driver\sqlite\Install\Tasks as BaseTasks;
+use Drupal\sqlite\Driver\Database\sqlite\Install\Tasks as BaseTasks;
 
 class Tasks extends BaseTasks {
 }
diff --git a/core/modules/system/tests/modules/driver_test/driver_test.info.yml b/core/modules/system/tests/modules/driver_test/driver_test.info.yml
index c36161d270..d00a582c01 100644
--- a/core/modules/system/tests/modules/driver_test/driver_test.info.yml
+++ b/core/modules/system/tests/modules/driver_test/driver_test.info.yml
@@ -3,3 +3,4 @@ type: module
 description: 'Support database contrib driver testing.'
 package: Testing
 version: VERSION
+hidden: true
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Connection.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Connection.php
index 9138084acf..a87a0d3869 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Connection.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Connection.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Connection as CoreConnection;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Connection.php';
+
+use Drupal\mysql\Driver\Database\mysql\Connection as CoreConnection;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Connection.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Delete.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Delete.php
index c3f248eaaf..712c1044ce 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Delete.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Delete.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Delete as CoreDelete;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Delete.php';
+
+use Drupal\mysql\Driver\Database\mysql\Delete as CoreDelete;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Delete.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Insert.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Insert.php
index a9545d77c0..8c15b608fe 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Insert.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Insert.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Insert as CoreInsert;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Insert.php';
+
+use Drupal\mysql\Driver\Database\mysql\Insert as CoreInsert;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Insert.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php
index 5c10c2c6be..2b20ba147f 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Install/Tasks.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql\Install;
 
-use Drupal\Core\Database\Driver\mysql\Install\Tasks as CoreTasks;
+include_once dirname(__DIR__, 9) . '/mysql/src/Driver/Database/mysql/Install/Tasks.php';
+
+use Drupal\mysql\Driver\Database\mysql\Install\Tasks as CoreTasks;
 
 /**
  * Specifies installation tasks for MySQL test databases.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Merge.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Merge.php
index 2be3c0cede..969c9c64c0 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Merge.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Merge.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Merge as CoreMerge;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Merge.php';
+
+use Drupal\mysql\Driver\Database\mysql\Merge as CoreMerge;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Merge.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Schema.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Schema.php
index 69277a1391..b3a2dc01fe 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Schema.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Schema.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Schema as CoreSchema;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Schema.php';
+
+use Drupal\mysql\Driver\Database\mysql\Schema as CoreSchema;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Schema.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Select.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Select.php
index ffe4ada5c1..d3552f3d79 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Select.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Select.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Select as CoreSelect;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Select.php';
+
+use Drupal\mysql\Driver\Database\mysql\Select as CoreSelect;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Select.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Transaction.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Transaction.php
index 1ace8d6fd3..12245787cc 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Transaction.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Transaction.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Transaction as CoreTransaction;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Transaction.php';
+
+use Drupal\mysql\Driver\Database\mysql\Transaction as CoreTransaction;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Transaction.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Truncate.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Truncate.php
index 33d8d85b73..81977afc0f 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Truncate.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Truncate.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Truncate as CoreTruncate;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Truncate.php';
+
+use Drupal\mysql\Driver\Database\mysql\Truncate as CoreTruncate;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Truncate.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Update.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Update.php
index 01d8e38b7f..ae9af99ae4 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Update.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Update.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Update as CoreUpdate;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Update.php';
+
+use Drupal\mysql\Driver\Database\mysql\Update as CoreUpdate;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Update.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Upsert.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Upsert.php
index 8b4bb48258..dd2d71af8c 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Upsert.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/Upsert.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestMysql;
 
-use Drupal\Core\Database\Driver\mysql\Upsert as CoreUpsert;
+include_once dirname(__DIR__, 8) . '/mysql/src/Driver/Database/mysql/Upsert.php';
+
+use Drupal\mysql\Driver\Database\mysql\Upsert as CoreUpsert;
 
 /**
  * MySQL test implementation of \Drupal\Core\Database\Query\Upsert.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Connection.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Connection.php
index 87dcf7dd4a..e45d48ade9 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Connection.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Connection.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Connection as CoreConnection;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Connection.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Connection as CoreConnection;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Connection.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Delete.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Delete.php
index 5340c8afb0..92081533cb 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Delete.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Delete.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Delete as CoreDelete;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Delete.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Delete as CoreDelete;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Delete.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Insert.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Insert.php
index a2f6f0791a..957373ffc3 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Insert.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Insert.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Insert as CoreInsert;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Insert.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Insert as CoreInsert;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Insert.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Install/Tasks.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Install/Tasks.php
index 55705d832a..a8c096438f 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Install/Tasks.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Install/Tasks.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql\Install;
 
-use Drupal\Core\Database\Driver\pgsql\Install\Tasks as CoreTasks;
+include_once dirname(__DIR__, 9) . '/pgsql/src/Driver/Database/pgsql/Install/Tasks.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Install\Tasks as CoreTasks;
 
 /**
  * Specifies installation tasks for PostgreSQL databases.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Merge.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Merge.php
index 1d79ef3714..49a548daf4 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Merge.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Merge.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Merge as CoreMerge;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Merge.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Merge as CoreMerge;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Merge.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/NativeUpsert.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/NativeUpsert.php
index cf955a48ac..bf23f087f7 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/NativeUpsert.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/NativeUpsert.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\NativeUpsert as CoreNativeUpsert;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/NativeUpsert.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\NativeUpsert as CoreNativeUpsert;
 
 /**
  * PostgreSQL implementation of native \Drupal\Core\Database\Query\Upsert.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Schema.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Schema.php
index 8cfa969126..df0c45c222 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Schema.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Schema.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Schema as CoreSchema;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Schema.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Schema as CoreSchema;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Schema.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Select.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Select.php
index f0faf65ca6..b11fbefe11 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Select.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Select.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Select as CoreSelect;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Select.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Select as CoreSelect;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Select.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Transaction.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Transaction.php
index 7be4dbf8db..0fb505c0e7 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Transaction.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Transaction.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Transaction as CoreTransaction;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Transaction.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Transaction as CoreTransaction;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Transaction.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Truncate.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Truncate.php
index c1b4322d5b..61b58711ff 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Truncate.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Truncate.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Truncate as CoreTruncate;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Truncate.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Truncate as CoreTruncate;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Truncate.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Update.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Update.php
index d5ed1ed5f0..e30ace4bc8 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Update.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Update.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Update as CoreUpdate;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Update.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Update as CoreUpdate;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Update.
diff --git a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Upsert.php b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Upsert.php
index 2237a755cf..b36b039bf9 100644
--- a/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Upsert.php
+++ b/core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestPgsql/Upsert.php
@@ -2,7 +2,9 @@
 
 namespace Drupal\driver_test\Driver\Database\DrivertestPgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Upsert as CoreUpsert;
+include_once dirname(__DIR__, 8) . '/pgsql/src/Driver/Database/pgsql/Upsert.php';
+
+use Drupal\pgsql\Driver\Database\pgsql\Upsert as CoreUpsert;
 
 /**
  * PostgreSQL implementation of \Drupal\Core\Database\Query\Upsert.
diff --git a/core/modules/views/src/Plugin/views/argument/StringArgument.php b/core/modules/views/src/Plugin/views/argument/StringArgument.php
index 7bde8ff5c7..29a945e9d3 100644
--- a/core/modules/views/src/Plugin/views/argument/StringArgument.php
+++ b/core/modules/views/src/Plugin/views/argument/StringArgument.php
@@ -178,7 +178,7 @@ public function getFormula() {
     if ($this->options['case'] != 'none') {
       // Support case-insensitive substring comparisons for SQLite by using the
       // 'NOCASE_UTF8' collation.
-      // @see Drupal\Core\Database\Driver\sqlite\Connection::open()
+      // @see Drupal\sqlite\Driver\Database\sqlite\Connection::open()
       if (Database::getConnection()->databaseType() == 'sqlite') {
         $formula .= ' COLLATE NOCASE_UTF8';
       }
diff --git a/core/modules/views/src/Plugin/views/query/SqliteDateSql.php b/core/modules/views/src/Plugin/views/query/SqliteDateSql.php
index 2275d4c6c3..6e52eba39f 100644
--- a/core/modules/views/src/Plugin/views/query/SqliteDateSql.php
+++ b/core/modules/views/src/Plugin/views/query/SqliteDateSql.php
@@ -97,7 +97,7 @@ public function getDateFormat($field, $format) {
     // case the comparison value is a float, integer, or numeric. All of the
     // above SQLite format tokens only produce integers. However, the given
     // $format may contain 'Y-m-d', which results in a string.
-    // @see \Drupal\Core\Database\Driver\sqlite\Connection::expandArguments()
+    // @see \Drupal\sqlite\Driver\Database\sqlite\Connection::expandArguments()
     // @see http://www.sqlite.org/lang_datefunc.html
     // @see http://www.sqlite.org/lang_expr.html#castexpr
     if (preg_match('/^(?:%\w)+$/', $format)) {
diff --git a/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php b/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
index c96a0f1947..721766587f 100644
--- a/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
+++ b/core/tests/Drupal/BuildTests/Framework/Tests/HtRouterTest.php
@@ -3,7 +3,7 @@
 namespace Drupal\BuildTests\Framework\Tests;
 
 use Drupal\BuildTests\QuickStart\QuickStartTestBase;
-use Drupal\Core\Database\Driver\sqlite\Install\Tasks;
+use Drupal\sqlite\Driver\Database\sqlite\Install\Tasks;
 
 /**
  * @coversDefaultClass \Drupal\BuildTests\Framework\BuildTestBase
diff --git a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
index 7ff31796d4..1a0e4f6a7d 100644
--- a/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Cache/EndOfTransactionQueriesTest.php
@@ -31,12 +31,12 @@ class EndOfTransactionQueriesTest extends KernelTestBase {
    * {@inheritdoc}
    */
   protected function setUp(): void {
+    parent::setUp();
+
     if (!class_exists($this->getDatabaseConnectionInfo()['default']['namespace'] . '\Connection')) {
       $this->markTestSkipped(sprintf('No logging override exists for the %s database driver. Create it, subclass this test class and override ::getDatabaseConnectionInfo().', $this->getDatabaseConnectionInfo()['default']['driver']));
     }
 
-    parent::setUp();
-
     $this->installSchema('system', 'sequences');
     $this->installEntitySchema('entity_test');
     $this->installEntitySchema('user');
diff --git a/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php b/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php
index efa0c53ed8..2afec6de82 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/PrefixInfoTest.php
@@ -15,7 +15,7 @@ class PrefixInfoTest extends DatabaseTestBase {
    * Tests that DatabaseSchema::getPrefixInfo() returns the right database.
    *
    * We are testing if the return array of the method
-   * \Drupal\Core\Database\Driver\mysql\Schema::getPrefixInfo(). This return
+   * \Drupal\mysql\Driver\Database\mysql\Schema::getPrefixInfo(). This return
    * array is a keyed array with info about amongst other things the database.
    * The other two by Drupal core supported databases do not have this variable
    * set in the return array.
diff --git a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
index a8560b56c0..32a9aa4814 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/QueryTest.php
@@ -138,7 +138,7 @@ public function testConditionOperatorArgumentsSQLInjection() {
   /**
    * Tests numeric query parameter expansion in expressions.
    *
-   * @see \Drupal\Core\Database\Driver\sqlite\Statement::getStatement()
+   * @see \Drupal\sqlite\Driver\Database\sqlite\Statement::getStatement()
    * @see http://bugs.php.net/bug.php?id=45259
    */
   public function testNumericExpressionSubstitution() {
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
index aef1c7412c..9bc5253ade 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SchemaTest.php
@@ -276,9 +276,9 @@ public function testSchema() {
   }
 
   /**
-   * @covers \Drupal\Core\Database\Driver\mysql\Schema::introspectIndexSchema
-   * @covers \Drupal\Core\Database\Driver\pgsql\Schema::introspectIndexSchema
-   * @covers \Drupal\Core\Database\Driver\sqlite\Schema::introspectIndexSchema
+   * @covers \Drupal\mysql\Driver\Database\mysql\Schema::introspectIndexSchema
+   * @covers \Drupal\pgsql\Driver\Database\pgsql\Schema::introspectIndexSchema
+   * @covers \Drupal\sqlite\Driver\Database\sqlite\Schema::introspectIndexSchema
    */
   public function testIntrospectIndexSchema() {
     $table_specification = [
@@ -355,7 +355,7 @@ public function testIntrospectIndexSchema() {
   /**
    * Tests that indexes on string fields are limited to 191 characters on MySQL.
    *
-   * @see \Drupal\Core\Database\Driver\mysql\Schema::getNormalizedIndexes()
+   * @see \Drupal\mysql\Driver\Database\mysql\Schema::getNormalizedIndexes()
    */
   public function testIndexLength() {
     if ($this->connection->databaseType() !== 'mysql') {
diff --git a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
index 73b48a1cf3..331655f008 100644
--- a/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
+++ b/core/tests/Drupal/KernelTests/Core/Database/SelectComplexTest.php
@@ -234,7 +234,7 @@ public function testCountQueryRemovals() {
     // Check that the ordering clause is handled properly.
     $orderby = $query->getOrderBy();
     // The orderby string is different for PostgreSQL.
-    // @see Drupal\Core\Database\Driver\pgsql\Select::orderBy()
+    // @see Drupal\pgsql\Driver\Database\pgsql\Select::orderBy()
     $db_type = Database::getConnection()->databaseType();
     $this->assertEqual($orderby['name'], ($db_type == 'pgsql' ? 'ASC NULLS FIRST' : 'ASC'), 'Query correctly sets ordering clause.');
     $orderby = $count->getOrderBy();
diff --git a/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php b/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php
index 0713af5c7c..6a37295998 100644
--- a/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php
+++ b/core/tests/Drupal/TestSite/Commands/TestSiteTearDownCommand.php
@@ -80,6 +80,7 @@ protected function execute(InputInterface $input, OutputInterface $output) {
   protected function tearDown(TestDatabase $test_database, $db_url): void {
     // Connect to the test database.
     $root = dirname(dirname(dirname(dirname(dirname(__DIR__)))));
+    require_once $root . '/core/includes/bootstrap.inc';
     $database = Database::convertDbUrlToConnectionInfo($db_url, $root);
     $database['prefix'] = ['default' => $test_database->getDatabasePrefix()];
     Database::addConnectionInfo(__CLASS__, 'default', $database);
diff --git a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
index 3d0c037361..6329c3bcfd 100644
--- a/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
+++ b/core/tests/Drupal/Tests/Core/Command/QuickStartTest.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\Core\Command;
 
-use Drupal\Core\Database\Driver\sqlite\Install\Tasks;
+use Drupal\sqlite\Driver\Database\sqlite\Install\Tasks;
 use Drupal\Core\Test\TestDatabase;
 use Drupal\Tests\BrowserTestBase;
 use GuzzleHttp\Client;
diff --git a/core/tests/Drupal/Tests/Core/Database/DatabaseTest.php b/core/tests/Drupal/Tests/Core/Database/DatabaseTest.php
index 5895bc2bd9..22b6122c45 100644
--- a/core/tests/Drupal/Tests/Core/Database/DatabaseTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/DatabaseTest.php
@@ -70,7 +70,7 @@ public function testFindDriverAutoloadDirectory($expected, $namespace) {
    */
   public function providerFindDriverAutoloadDirectory() {
     return [
-      'core mysql' => [FALSE, 'Drupal\Core\Database\Driver\mysql'],
+      'core mysql' => ['core/modules/mysql/src/Driver/Database/mysql/', 'Drupal\mysql\Driver\Database\mysql'],
       'D8 custom fake' => [FALSE, 'Drupal\Driver\Database\corefake'],
       'module mysql' => ['core/modules/system/tests/modules/driver_test/src/Driver/Database/DrivertestMysql/', 'Drupal\driver_test\Driver\Database\DrivertestMysql'],
     ];
diff --git a/core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php b/core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php
index 4379ef8318..1e6c6b0abe 100644
--- a/core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/Driver/mysql/ConnectionTest.php
@@ -2,13 +2,13 @@
 
 namespace Drupal\Tests\Core\Database\Driver\mysql;
 
-use Drupal\Core\Database\Driver\mysql\Connection;
+use Drupal\mysql\Driver\Database\mysql\Connection;
 use Drupal\Tests\UnitTestCase;
 
 /**
  * Tests MySQL database connections.
  *
- * @coversDefaultClass \Drupal\Core\Database\Driver\mysql\Connection
+ * @coversDefaultClass \Drupal\mysql\Driver\Database\mysql\Connection
  * @group Database
  */
 class ConnectionTest extends UnitTestCase {
@@ -30,7 +30,7 @@ public function setUp(): void {
   /**
    * Creates a Connection object for testing.
    *
-   * @return \Drupal\Core\Database\Driver\mysql\Connection
+   * @return \Drupal\mysql\Driver\Database\mysql\Connection
    */
   private function createConnection(): Connection {
     /** @var \PDO $pdo_connection */
diff --git a/core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php b/core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php
index ab64e21a4e..b26a3ee779 100644
--- a/core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/Driver/mysql/install/TasksTest.php
@@ -2,14 +2,14 @@
 
 namespace Drupal\Tests\Core\Database\Driver\mysql\install;
 
-use Drupal\Core\Database\Driver\mysql\Connection;
-use Drupal\Core\Database\Driver\mysql\Install\Tasks;
+use Drupal\mysql\Driver\Database\mysql\Connection;
+use Drupal\mysql\Driver\Database\mysql\Install\Tasks;
 use Drupal\Tests\UnitTestCase;
 
 /**
  * Tests the MySQL install tasks.
  *
- * @coversDefaultClass \Drupal\Core\Database\Driver\mysql\Install\Tasks
+ * @coversDefaultClass \Drupal\mysql\Driver\Database\mysql\Install\Tasks
  * @group Database
  */
 class TasksTest extends UnitTestCase {
@@ -17,7 +17,7 @@ class TasksTest extends UnitTestCase {
   /**
    * A connection object prophecy.
    *
-   * @var \Drupal\Core\Database\Driver\mysql\Connection|\Prophecy\Prophecy\ObjectProphecy
+   * @var \Drupal\mysql\Driver\Database\mysql\Connection|\Prophecy\Prophecy\ObjectProphecy
    */
   private $connection;
 
@@ -31,10 +31,10 @@ public function setUp(): void {
   /**
    * Creates a Tasks object for testing.
    *
-   * @return \Drupal\Core\Database\Driver\mysql\Install\Tasks
+   * @return \Drupal\mysql\Driver\Database\mysql\Install\Tasks
    */
   private function createTasks(): Tasks {
-    /** @var \Drupal\Core\Database\Driver\mysql\Connection $connection */
+    /** @var \Drupal\mysql\Driver\Database\mysql\Connection $connection */
     $connection = $this->connection->reveal();
 
     return new class($connection) extends Tasks {
@@ -63,7 +63,7 @@ protected function t($string, array $args = [], array $options = []) {
   /**
    * Creates a Tasks object for testing, without connection.
    *
-   * @return \Drupal\Core\Database\Driver\mysql\Install\Tasks
+   * @return \Drupal\mysql\Driver\Database\mysql\Install\Tasks
    */
   private function createTasksNoConnection(): Tasks {
     return new class() extends Tasks {
diff --git a/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php b/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
index a9a4aeb7af..d8163f681b 100644
--- a/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/Driver/pgsql/PostgresqlSchemaTest.php
@@ -2,11 +2,11 @@
 
 namespace Drupal\Tests\Core\Database\Driver\pgsql;
 
-use Drupal\Core\Database\Driver\pgsql\Schema;
+use Drupal\pgsql\Driver\Database\pgsql\Schema;
 use Drupal\Tests\UnitTestCase;
 
 /**
- * @coversDefaultClass \Drupal\Core\Database\Driver\pgsql\Schema
+ * @coversDefaultClass \Drupal\pgsql\Driver\Database\pgsql\Schema
  * @group Database
  */
 class PostgresqlSchemaTest extends UnitTestCase {
@@ -14,7 +14,7 @@ class PostgresqlSchemaTest extends UnitTestCase {
   /**
    * The PostgreSql DB connection.
    *
-   * @var \PHPUnit\Framework\MockObject\MockObject|\Drupal\Core\Database\Driver\pgsql\Connection
+   * @var \PHPUnit\Framework\MockObject\MockObject|\Drupal\pgsql\Driver\Database\pgsql\Connection
    */
   protected $connection;
 
@@ -24,7 +24,7 @@ class PostgresqlSchemaTest extends UnitTestCase {
   protected function setUp(): void {
     parent::setUp();
 
-    $this->connection = $this->getMockBuilder('\Drupal\Core\Database\Driver\pgsql\Connection')
+    $this->connection = $this->getMockBuilder('\Drupal\pgsql\Driver\Database\pgsql\Connection')
       ->disableOriginalConstructor()
       ->getMock();
   }
diff --git a/core/tests/Drupal/Tests/Core/Database/InstallerObjectTest.php b/core/tests/Drupal/Tests/Core/Database/InstallerObjectTest.php
index 7b605e262e..049fc4bda3 100644
--- a/core/tests/Drupal/Tests/Core/Database/InstallerObjectTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/InstallerObjectTest.php
@@ -3,7 +3,7 @@
 namespace Drupal\Tests\Core\Database;
 
 use Composer\Autoload\ClassLoader;
-use Drupal\Core\Database\Driver\mysql\Install\Tasks as MysqlInstallTasks;
+use Drupal\mysql\Driver\Database\mysql\Install\Tasks as MysqlInstallTasks;
 use Drupal\Driver\Database\fake\Install\Tasks as FakeInstallTasks;
 use Drupal\Driver\Database\corefake\Install\Tasks as CustomCoreFakeInstallTasks;
 use Drupal\driver_test\Driver\Database\DrivertestMysql\Install\Tasks as DriverTestMysqlInstallTasks;
@@ -58,7 +58,7 @@ public function testDbInstallerObject($driver, $namespace, $expected_class_name)
   public function providerDbInstallerObject() {
     return [
       // A driver only in the core namespace.
-      ['mysql', NULL, MysqlInstallTasks::class],
+      ['mysql', "Drupal\\mysql\\Driver\\Database\\mysql", MysqlInstallTasks::class],
 
       // A driver only in the custom namespace.
       ['fake', "Drupal\\Driver\\Database\\fake", FakeInstallTasks::class],
diff --git a/core/tests/Drupal/Tests/Core/Database/Stub/Select.php b/core/tests/Drupal/Tests/Core/Database/Stub/Select.php
index b29ac1a021..234297e8c9 100644
--- a/core/tests/Drupal/Tests/Core/Database/Stub/Select.php
+++ b/core/tests/Drupal/Tests/Core/Database/Stub/Select.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\Tests\Core\Database\Stub;
 
-use Drupal\Core\Database\Driver\mysql\Select as QuerySelect;
+use Drupal\mysql\Driver\Database\mysql\Select as QuerySelect;
 
 class Select extends QuerySelect {
 
diff --git a/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php b/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php
index a3e7325f21..a211611be8 100644
--- a/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php
+++ b/core/tests/Drupal/Tests/Core/Database/UrlConversionTest.php
@@ -26,7 +26,7 @@ class UrlConversionTest extends UnitTestCase {
    */
   protected function setUp(): void {
     parent::setUp();
-    $this->root = dirname(dirname(dirname(dirname(dirname(dirname(dirname(__FILE__)))))));
+    $this->root = dirname(__FILE__, 7);
     // Mock the container so we don't need to mock drupal_valid_test_ua().
     // @see \Drupal\Core\Extension\ExtensionDiscovery::scan()
     $container = $this->createMock('Symfony\Component\DependencyInjection\ContainerInterface');
@@ -48,8 +48,8 @@ protected function setUp(): void {
    *
    * @dataProvider providerConvertDbUrlToConnectionInfo
    */
-  public function testDbUrltoConnectionConversion($root, $url, $database_array) {
-    $result = Database::convertDbUrlToConnectionInfo($url, $root ?: $this->root);
+  public function testDbUrltoConnectionConversion($url, $database_array) {
+    $result = Database::convertDbUrlToConnectionInfo($url, $this->root);
     $this->assertEquals($database_array, $result);
   }
 
@@ -58,14 +58,13 @@ public function testDbUrltoConnectionConversion($root, $url, $database_array) {
    *
    * @return array
    *   Array of arrays with the following elements:
-   *   - root: The baseroot string, only used with sqlite drivers.
    *   - url: The full URL string to be tested.
    *   - database_array: An array containing the expected results.
    */
   public function providerConvertDbUrlToConnectionInfo() {
+    $root = dirname(__FILE__, 7);
     return [
       'MySql without prefix' => [
-        '',
         'mysql://test_user:test_pass@test_host:3306/test_database',
         [
           'driver' => 'mysql',
@@ -74,21 +73,21 @@ public function providerConvertDbUrlToConnectionInfo() {
           'host' => 'test_host',
           'database' => 'test_database',
           'port' => 3306,
-          'namespace' => 'Drupal\Core\Database\Driver\mysql',
+          'namespace' => 'Drupal\mysql\Driver\Database\mysql',
+          'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
         ],
       ],
       'SQLite, relative to root, without prefix' => [
-        '/var/www/d8',
         'sqlite://localhost/test_database',
         [
           'driver' => 'sqlite',
           'host' => 'localhost',
-          'database' => '/var/www/d8/test_database',
-          'namespace' => 'Drupal\Core\Database\Driver\sqlite',
+          'database' => $root . '/test_database',
+          'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
+          'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
         ],
       ],
       'MySql with prefix' => [
-        '',
         'mysql://test_user:test_pass@test_host:3306/test_database#bar',
         [
           'driver' => 'mysql',
@@ -100,34 +99,34 @@ public function providerConvertDbUrlToConnectionInfo() {
             'default' => 'bar',
           ],
           'port' => 3306,
-          'namespace' => 'Drupal\Core\Database\Driver\mysql',
+          'namespace' => 'Drupal\mysql\Driver\Database\mysql',
+          'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
         ],
       ],
       'SQLite, relative to root, with prefix' => [
-        '/var/www/d8',
         'sqlite://localhost/test_database#foo',
         [
           'driver' => 'sqlite',
           'host' => 'localhost',
-          'database' => '/var/www/d8/test_database',
+          'database' => $root . '/test_database',
           'prefix' => [
             'default' => 'foo',
           ],
-          'namespace' => 'Drupal\Core\Database\Driver\sqlite',
+          'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
+          'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
         ],
       ],
       'SQLite, absolute path, without prefix' => [
-        '/var/www/d8',
         'sqlite://localhost//baz/test_database',
         [
           'driver' => 'sqlite',
           'host' => 'localhost',
           'database' => '/baz/test_database',
-          'namespace' => 'Drupal\Core\Database\Driver\sqlite',
+          'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
+          'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
         ],
       ],
       'MySQL contrib test driver without prefix' => [
-        '',
         'DrivertestMysql://test_user:test_pass@test_host:3306/test_database?module=driver_test',
         [
           'driver' => 'DrivertestMysql',
@@ -141,7 +140,6 @@ public function providerConvertDbUrlToConnectionInfo() {
         ],
       ],
       'MySQL contrib test driver with prefix' => [
-        '',
         'DrivertestMysql://test_user:test_pass@test_host:3306/test_database?module=driver_test#bar',
         [
           'driver' => 'DrivertestMysql',
@@ -158,7 +156,6 @@ public function providerConvertDbUrlToConnectionInfo() {
         ],
       ],
       'PostgreSQL contrib test driver without prefix' => [
-        '',
         'DrivertestPgsql://test_user:test_pass@test_host:5432/test_database?module=driver_test',
         [
           'driver' => 'DrivertestPgsql',
@@ -172,7 +169,6 @@ public function providerConvertDbUrlToConnectionInfo() {
         ],
       ],
       'PostgreSQL contrib test driver with prefix' => [
-        '',
         'DrivertestPgsql://test_user:test_pass@test_host:5432/test_database?module=driver_test#bar',
         [
           'driver' => 'DrivertestPgsql',
@@ -189,7 +185,6 @@ public function providerConvertDbUrlToConnectionInfo() {
         ],
       ],
       'MySql with a custom query parameter' => [
-        '',
         'mysql://test_user:test_pass@test_host:3306/test_database?extra=value',
         [
           'driver' => 'mysql',
@@ -198,7 +193,55 @@ public function providerConvertDbUrlToConnectionInfo() {
           'host' => 'test_host',
           'database' => 'test_database',
           'port' => 3306,
-          'namespace' => 'Drupal\Core\Database\Driver\mysql',
+          'namespace' => 'Drupal\mysql\Driver\Database\mysql',
+          'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
+        ],
+      ],
+      'MySql with the module name mysql' => [
+        'mysql://test_user:test_pass@test_host:3306/test_database?module=mysql',
+        [
+          'driver' => 'mysql',
+          'username' => 'test_user',
+          'password' => 'test_pass',
+          'host' => 'test_host',
+          'database' => 'test_database',
+          'port' => 3306,
+          'namespace' => 'Drupal\mysql\Driver\Database\mysql',
+          'autoload' => 'core/modules/mysql/src/Driver/Database/mysql/',
+        ],
+      ],
+      'PostgreSql without the module name set' => [
+        'pgsql://test_user:test_pass@test_host/test_database',
+        [
+          'driver' => 'pgsql',
+          'username' => 'test_user',
+          'password' => 'test_pass',
+          'host' => 'test_host',
+          'database' => 'test_database',
+          'namespace' => 'Drupal\pgsql\Driver\Database\pgsql',
+          'autoload' => 'core/modules/pgsql/src/Driver/Database/pgsql/',
+        ],
+      ],
+      'PostgreSql with the module name pgsql' => [
+        'pgsql://test_user:test_pass@test_host/test_database?module=pgsql',
+        [
+          'driver' => 'pgsql',
+          'username' => 'test_user',
+          'password' => 'test_pass',
+          'host' => 'test_host',
+          'database' => 'test_database',
+          'namespace' => 'Drupal\pgsql\Driver\Database\pgsql',
+          'autoload' => 'core/modules/pgsql/src/Driver/Database/pgsql/',
+        ],
+      ],
+      'SQLite, relative to root, without prefix and with the module name sqlite' => [
+        'sqlite://localhost/test_database?module=sqlite',
+        [
+          'driver' => 'sqlite',
+          'host' => 'localhost',
+          'database' => $root . '/test_database',
+          'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
+          'autoload' => 'core/modules/sqlite/src/Driver/Database/sqlite/',
         ],
       ],
     ];
@@ -266,7 +309,7 @@ public function providerGetConnectionInfoAsUrl() {
       'port' => '3306',
       'driver' => 'mysql',
     ];
-    $expected_url1 = 'mysql://test_user:test_pass@test_host:3306/test_database';
+    $expected_url1 = 'mysql://test_user:test_pass@test_host:3306/test_database?module=mysql';
 
     $info2 = [
       'database' => 'test_database',
@@ -277,7 +320,7 @@ public function providerGetConnectionInfoAsUrl() {
       'port' => '3306',
       'driver' => 'mysql',
     ];
-    $expected_url2 = 'mysql://test_user:test_pass@test_host:3306/test_database#pre';
+    $expected_url2 = 'mysql://test_user:test_pass@test_host:3306/test_database?module=mysql#pre';
 
     $info3 = [
       'database' => 'test_database',
@@ -390,7 +433,7 @@ public function providerInvalidArgumentGetConnectionInfoAsUrl() {
         [
           'driver' => 'sqlite',
           'host' => 'localhost',
-          'namespace' => 'Drupal\Core\Database\Driver\sqlite',
+          'namespace' => 'Drupal\sqlite\Driver\Database\sqlite',
         ],
         "As a minimum, the connection options array must contain at least the 'driver' and 'database' keys",
       ],
diff --git a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
index 7f3ad10db0..1cfb70146e 100644
--- a/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
+++ b/core/tests/Drupal/Tests/Core/DependencyInjection/Compiler/BackendCompilerPassTest.php
@@ -103,7 +103,7 @@ protected function getSqliteContainer($service) {
     $container = new ContainerBuilder();
     $container->setDefinition('service', $service);
     $container->setDefinition('sqlite.service', new Definition(__NAMESPACE__ . '\\ServiceClassSqlite'));
-    $mock = $this->getMockBuilder('Drupal\Core\Database\Driver\sqlite\Connection')->setMethods(NULL)->disableOriginalConstructor()->getMock();
+    $mock = $this->getMockBuilder('Drupal\sqlite\Driver\Database\sqlite\Connection')->setMethods(NULL)->disableOriginalConstructor()->getMock();
     $container->set('database', $mock);
     return $container;
   }
diff --git a/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php b/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
index d0b8283566..d8d4d760bb 100644
--- a/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
+++ b/core/tests/Drupal/Tests/Core/Test/TestSetupTraitTest.php
@@ -25,8 +25,10 @@ class TestSetupTraitTest extends UnitTestCase {
    * @covers ::changeDatabasePrefix
    */
   public function testChangeDatabasePrefix() {
+    $root = dirname(__FILE__, 7);
+    require_once $root . '/core/includes/bootstrap.inc';
     putenv('SIMPLETEST_DB=pgsql://user:pass@127.0.0.1/db');
-    $connection_info = Database::convertDbUrlToConnectionInfo('mysql://user:pass@localhost/db', '');
+    $connection_info = Database::convertDbUrlToConnectionInfo('mysql://user:pass@localhost/db', $root);
     Database::addConnectionInfo('default', 'default', $connection_info);
     $this->assertEquals('mysql', Database::getConnectionInfo()['default']['driver']);
     $this->assertEquals('localhost', Database::getConnectionInfo()['default']['host']);
@@ -35,7 +37,7 @@ public function testChangeDatabasePrefix() {
     // used to avoid unnecessary set up.
     $test_setup = $this->getMockForTrait(TestSetupTrait::class);
     $test_setup->databasePrefix = 'testDbPrefix';
-    $test_setup->root = '';
+    $test_setup->root = $root;
 
     $method = new \ReflectionMethod(get_class($test_setup), 'changeDatabasePrefix');
     $method->setAccessible(TRUE);
diff --git a/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php b/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php
index caabc84f75..c8e0a9e5f2 100644
--- a/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php
+++ b/core/tests/Drupal/Tests/Scripts/TestSiteApplicationTest.php
@@ -43,6 +43,7 @@ protected function setUp(): void {
     $php_executable_finder = new PhpExecutableFinder();
     $this->php = $php_executable_finder->find();
     $this->root = dirname(dirname(substr(__DIR__, 0, -strlen(__NAMESPACE__))));
+    require_once $this->root . '/core/includes/bootstrap.inc';
   }
 
   /**
diff --git a/sites/default/default.settings.php b/sites/default/default.settings.php
index 76e509abeb..c1e0764b46 100644
--- a/sites/default/default.settings.php
+++ b/sites/default/default.settings.php
@@ -203,9 +203,9 @@
  * information on these defaults and the potential issues.
  *
  * More details can be found in the constructor methods for each driver:
- * - \Drupal\Core\Database\Driver\mysql\Connection::__construct()
- * - \Drupal\Core\Database\Driver\pgsql\Connection::__construct()
- * - \Drupal\Core\Database\Driver\sqlite\Connection::__construct()
+ * - \Drupal\mysql\Driver\Database\mysql\Connection::__construct()
+ * - \Drupal\pgsql\Driver\Database\pgsql\Connection::__construct()
+ * - \Drupal\sqlite\Driver\Database\sqlite\Connection::__construct()
  *
  * Sample Database configuration format for PostgreSQL (pgsql):
  * @code
