def valid_server?(server, port = DFT_PORT)
      mysql = Mysql.init
      mysql.options Mysql::OPT_CONNECT_TIMEOUT, 5

      begin
        # this connection should get an access denied error if there is
        # a mysql server there. I'm assuming no one will use this username
        # and pw for anything real
        mysql.connect server, 'notArealUser', "definatelyNotA#{$PROCESS_ID}password", 'not_a_db', port

      rescue Mysql::ServerError::AccessDeniedError
        return true
      rescue
        return false
      end
      false
    end
def valid_server?(server, port = DFT_PORT)
      mysql = Mysql.init
      mysql.options Mysql::OPT_CONNECT_TIMEOUT, 5

      begin
        # this connection should get an access denied error if there is
        # a mysql server there. I'm assuming no one will use this username
        # and pw for anything real
        mysql.connect server, 'notArealUser', "definatelyNotA#{$PROCESS_ID}password", 'not_a_db', port

      rescue Mysql::ServerError::AccessDeniedError
        return true
      rescue
        return false
      end
      false
    end
disconnect
 Test that a given hostname is a MySQL server

 @param server[String] The hostname to test

 @return [Boolean] does the server host a MySQL server?