Syntax
INET_ATON(expr)
Purpose
You can call this function to convert an IPv4 network address into a string, and return an integer to indicate the address value in the network byte order which is most significant byte (MSB) first. It returns NULL if the argument is invalid.
Notice
Store the values generated by the
INET_ATON()function in anINT UNSIGNEDcolumn rather than a signedINTcolumn. If you use a signed column, when the IP address of the first octet is greater than 127, the corresponding value cannot be correctly stored.
Examples
obclient> SELECT INET_ATON('1.1.1.1');
+----------------------+
| INET_ATON('1.1.1.1') |
+----------------------+
| 16843009 |
+----------------------+
1 row in set