To convert a network address to a numeric value, use INET_ATON() function: INET_ATON()
mysql> mysql> SELECT INET_ATON('127.0.0.1'); +------------------------+ | INET_ATON('127.0.0.1') | +------------------------+ | 2130706433 | +------------------------+ 1 row in set (0.00 sec)