Product Solutions Support
Try MemSQL

INET_ATON

Converts an IPv4 address to a 32-bit integer.

INET_ATON ( ip )

Arguments

Return Type

Integer, or NULL if the IP address cannot be parsed.

Info

This function does not handle IPv6 addresses.

Examples

memsql> select inet_aton('1.2.3.4');
+----------------------+
| inet_aton('1.2.3.4') |
+----------------------+
|             16909060 |
+----------------------+

memsql> select inet_aton('127.1');
+--------------------+
| inet_aton('127.1') |
+--------------------+
|         2130706433 |
+--------------------+

memsql> select inet_aton('127.0.0.1');
+------------------------+
| inet_aton('127.0.0.1') |
+------------------------+
|             2130706433 |
+------------------------+

memsql> select inet_aton('2a03:2880:10:1f02:face:b00c::25');
+----------------------------------------------+
| inet_aton('2a03:2880:10:1f02:face:b00c::25') |
+----------------------------------------------+
|                                         NULL |
+----------------------------------------------+
Was this article useful?