Declaration
INET_ATON(expr)
Description
Converts an IPv4 network address into a string and returns an integer representing the address value in network byte order (big-endian). If the parameter is invalid, NULL is returned.
Notice
Use the INT UNSIGNED type to store values generated by INET_ATON(); do not use the signed INT type. If you use a signed column, the value cannot be stored correctly when the first octet of the IP address is greater than 127.
Examples
obclient> SELECT INET_ATON('1.1.1.1');
+----------------------+
| INET_ATON('1.1.1.1') |
+----------------------+
| 16843009 |
+----------------------+
1 row in set