$message .= ' A Unix socket file is used if you do not specify a host name or if you specify the special host name localhost.';
$message .= ' To connect via TPC/IP use an IP address (127.0.0.1 for IPv4) instead of "localhost".';
$message .= ' This message normally means that there is no MySQL server running on the system or that you are using an incorrect Unix socket file name when trying to connect to the server.';
throw new DatabaseConnectionRefusedException($e->
getMessage() . ' [Tip: ' .
$message . '] ',
$e->
getCode(),
$e);
} // Show message for TCP/IP connection.
$message = 'This message normally means that there is no MySQL server running on the system or that you are using an incorrect host name or port number when trying to connect to the server.';
$message .= ' You should also check that the TCP/IP port you are using has not been blocked by a firewall or port blocking service.';
throw new DatabaseConnectionRefusedException($e->
getMessage() . ' [Tip: ' .
$message . '] ',
$e->
getCode(),
$e);
case static::DATABASE_NOT_FOUND:
throw new DatabaseNotFoundException($e->
getMessage(),
$e->
getCode(),
$e);
case static::ACCESS_DENIED:
throw new DatabaseAccessDeniedException($e->
getMessage(),
$e->
getCode(),
$e);
default:
throw $e;
} } // Force MySQL to use the UTF-8 character set. Also set the collation, if a
// certain one has been set; otherwise, MySQL defaults to