mysql中的Ip转换成16进制的函数方法.

mysql>  select lower(conv(inet_aton('192.168.1.100'),10,16));
+-----------------------------------------------+
| lower(conv(inet_aton('192.168.1.100'),10,16)) |
+-----------------------------------------------+
| c0a80164                                      |
+-----------------------------------------------+
1 row in set (0.03 sec)
mysql> select inet_ntoa(conv('c0a80164',16,10));       
+-----------------------------------+
| inet_ntoa(conv('c0a80164',16,10)) |
+-----------------------------------+
| 192.168.1.100                     |
+-----------------------------------+
1 row in set (0.00 sec)


你可能感兴趣的:(mysql,16进制,IP转换)