How do I identify the host from which a connection is originating?

Within the PROCESSLIST, the host seems to be only show what appears to be a port. How do I identify the host from which that connection originated? (MemSQL 7.1.4)

> memsql> select id, user, host, db from PROCESSLIST;
> +------+---------------+-----------------+--------------------+
> | id   | user          | host            | db                 |
> +------+---------------+-----------------+--------------------+
> | 2029 | distributed   | :30443          | NULL               |
> | 2969 | root          | :18616          | hl7                |
> | 3991 | hl7_ingestion | :55955          | hl7                |
> | 3990 | mnagy         | localhost:15052 | information_schema |
> | 2911 | SDS_SJORDAN   | :42979          | crca_dm            |
> | 2909 | SDS_SJORDAN   | :42723          | crca_dm            |
> | 2908 | SDS_SJORDAN   | :41443          | crca_dm            |
> | 2907 | SDS_SJORDAN   | :40675          | crca_dm            |
> | 2901 | SDS_SGUDURU   | :10975          | crca_dm            |
> | 2855 | crca_app      | :59586          | crca_dm            |
> | 2854 | crca_app      | :59074          | crca_dm            |
> .
> .
> .

Thanks,
Marty

Hi Marty,

The host name only shows up in PROCESSLIST right now if memsql did a reverse DNS lookup to find it. We do that based on the setting of the skip_name_resolve system variable. In the default configuration (skip_name_resolve=auto) we would lookup the host name only if you had any GRANTs using host names (this is to avoid doing DNS lookups when we don’t need to).

We have changed this recently to show the ip address if we didn’t do a host name lookup, but its not available in a 7.1 release as of yet. I can look at getting it backported into 7.1 since its very small change.

-Adam

1 Like

Thank you Adam.

Is there any potential negative impact by setting skip_name_resolve=on ?

skip_name_resolve = on means we will never do a DNS lookup. That means any GRANTS that are @hostname will never be matched on login (you would need to use ip address or wildcards in any GRANTS).

skip_name_resolve = off means every new connection to MemSQL will do a reverse DNS lookup. If the DNS lookup fails the connection will fail. If your DNS is reliable this isn’t an issue, but lots of folks don’t have reliable DNS (and it adds another point of failure to login).