In MySQL : mysql> SELECT INET_NTOA(ip_in_decimal) AS ipa; .. or the reverse : mysql> SELECT INET_ATON('dotted.quad') AS ipn;