diff --git a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
index cb8e5010463eb548df2d69368ec54dbfb17d0ecf..7048e88be1a432fe1f9d8fe36a7b1cc58b7cf41d 100644
--- a/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/pgsql/Connection.php
@@ -214,7 +214,7 @@ public function createDatabase($database) {
 
     try {
       // Create the database and set it as active.
-      $this->exec("CREATE DATABASE $database WITH TEMPLATE template0 ENCODING='utf8' LC_CTYPE='$locale.utf8' LC_COLLATE='$locale.utf8'");
+      $this->connection->exec("CREATE DATABASE $database WITH TEMPLATE template0 ENCODING='utf8' LC_CTYPE='$locale.utf8' LC_COLLATE='$locale.utf8'");
     }
     catch (\Exception $e) {
       throw new DatabaseNotFoundException($e->getMessage());
diff --git a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
index 2031e4b9249697fb5e59f412456580e2ab593224..6cacf4e3063822f1ac687ac640a87b1b0f3be949 100644
--- a/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
+++ b/core/lib/Drupal/Core/Database/Driver/sqlite/Connection.php
@@ -288,7 +288,7 @@ public function databaseType() {
    */
   public function createDatabase($database) {
     // Verify the database is writable.
-    $db_directory = new SplFileInfo(dirname($database));
+    $db_directory = new \SplFileInfo(dirname($database));
     if (!$db_directory->isDir() && !drupal_mkdir($db_directory->getPathName(), 0755, TRUE)) {
       throw new DatabaseNotFoundException('Unable to create database directory ' . $db_directory->getPathName());
     }