diff -u b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php --- b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php +++ b/core/lib/Drupal/Core/Database/Driver/mysql/Connection.php @@ -149,9 +149,9 @@ catch (\PDOException $e) { $message = $e->getMessage(); if ($e->getCode() == 2002) { - $message .= ' (This message indicates that MySQL is configured to use a socket that is not available. See the MySQL client documentation for the meaning of "localhost".)'; + $message .= '. (MySQL is configured to use "localhost" and the socket file was not found.)'; } - throw new DatabaseExceptionWrapper($message, 0, $e); + throw new \PDOException($message, $e->getCode(), $e); } // Force MySQL to use the UTF-8 character set. Also set the collation, if a