diff --git a/install.hostmaster.inc b/install.hostmaster.inc
index d8af5ff..a99f2ac 100644
--- a/install.hostmaster.inc
+++ b/install.hostmaster.inc
@@ -26,6 +26,14 @@ function drush_provision_hostmaster_install($site = NULL) {
   $aegir_db_user = drush_get_option('aegir_db_user', 'aegir_root', 'options');
   $master_db = sprintf("mysql://%s:%s@%s",$aegir_db_user, $aegir_db_pass, $aegir_host);
 
+  try {
+    $conn = new PDO("mysql:host=$aegir_host", $aegir_db_user, $aegir_db_pass);
+    drush_print(dt("Successfully connected to the DB server"));
+  }
+  catch(PDOException $e) {
+    return drush_set_error('PROVISION_DB_CONNECT_FAIL', $e->getMessage());
+  }
+
   // TODO: support creation of an external db server
   $server = '@server_master';
   drush_backend_invoke_args("provision-save", array($server), array(
diff --git a/install.sh.txt b/install.sh.txt
index 50fb52c..2786181 100644
--- a/install.sh.txt
+++ b/install.sh.txt
@@ -89,16 +89,6 @@ else
   true
 fi
 
-_MYSQLTEST=`mysql -h$AEGIR_HOST_IP  -uINVALIDLOGIN  -pINVALIDPASS 2>&1 >/dev/null | cat`
-
-if [ -z `echo $_MYSQLTEST | grep -q "ERROR \(2003\|1130\)"` ] ; then
-  msg  "MySQL is listening on $AEGIR_HOST_IP."
-  true
-else
-  msg "MySQL is not configured to listen on $AEGIR_HOST_IP."
-  exit 1
-fi
-
 msg "This script makes the following assumptions: "
 cat <<EOF
  * you have read INSTALL.txt and prepared the platform accordingly
