Skip to main content
Skip to main content

TO_IPV4

TO_IPV4​

SinceVersion dev

TO_IPV4

description​

Syntax​

IPV4 TO_IPV4(STRING ipv4_str)

This function like ipv4_string_to_num that takes a string form of IPv4 address and returns value of IPv4 type, which is binary equal to value returned by ipv4_string_to_num. If the IPv4 address has an invalid format, throw an exception.

notice​

Input cannot be NULL. If it is NULL, an exception will be thrown.

example​

mysql> select to_ipv4('255.255.255.255');
+----------------------------+
| to_ipv4('255.255.255.255') |
+----------------------------+
| 255.255.255.255 |
+----------------------------+

keywords​

TO_IPV4, IP