Syntax
IP2INT('ip_addr')
Purpose
IP2INT() converts the IP address ip_addr into an integer.
For example, the IP address s1.s2.s3.s4 is converted based on the following rule:
s1 * 2^24^ + s2 * 2^16^ + s3 * 2^8^ + s4
Examples
obclient> SELECT
IP2INT('0.0.0.1'),
HEX(IP2INT('0.0.0.1')),
HEX(IP2INT('1.0.0.0'))
\G
*************************** 1. row ***************************
IP2INT('0.0.0.1'): 1
HEX(IP2INT('0.0.0.1')): 1
HEX(IP2INT('1.0.0.0')): 1000000
1 row in set