首页 > 数据库技术 > 详细

mysql IPv4 IPv6

时间:2017-01-24 19:14:37      阅读:302      评论:0      收藏:0      [点我收藏+]

w如何通过一个mysql方法,而不是借助脚本判断?INET6_ATON(expr)

https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_inet-aton

https://dev.mysql.com/doc/refman/5.7/en/miscellaneous-functions.html#function_inet6-aton

Given an IPv6 or IPv4 network address as a string, returns a binary string that represents the numeric value of the address in network byte order (big endian). Because numeric-format IPv6 addresses require more bytes than the largest integer type, the representation returned by this function has the VARBINARY data type: VARBINARY(16) for IPv6 addresses and VARBINARY(4) for IPv4 addresses. If the argument is not a valid address, INET6_ATON() returns NULL.

The following examples use HEX() to display the INET6_ATON() result in printable form:

mysql IPv4 IPv6

原文:http://www.cnblogs.com/yuanjiangw/p/6347517.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!