MySQL:IP 地址转换(在点分格式和数字之间相互转换)
1. IP 由点分格式,转换为数字格式。 mysql> select inet_aton('127.0.0.1'); +------------------------+ | inet_aton('127.0.0.1') | +------------------------+ | 2130706433 | +------------------------+ 1 row in set (0.00 sec)
2. IP 由数字格式转换为点分格式。 mysql> select inet_ntoa(2130706433); +-----------------------+ | inet_ntoa(2130706433) | +-----------------------+ | 127.0.0.1 | +-----------------------+ 1 row in set (0.00 sec)
浙公网安备 33010602011771号