Jasper Bryant-Greene:
> Rhino wrote:
> > Isn't there a new way to express IP addresses called IPV6(?) which has a
> > possibility of 6 distinct parts instead of the traditional 4? I haven't
> > seen one of these new formats myself yet but for all I know, they will
> > become soon in the near future. Maybe you'd better choose a field type
> > that can accomodate those as well as the traditional 123.123.123.123
> > type....
>
> It's not a "new way to express IP addresses". It's a new version of IP,
> the Internet Protocol, and theoretically if the OP follows the good
> advice already given and stores the IP address in an unsigned integer
> field, he should be fine (assuming, probably safely, that
> INET_{ATON,NTOA}6() functions are made); although he may need a bigger
> integer type for IPv6 addresses.

An IPv6 address is 128 bits. That's twice as big as a MySQL bigint, so you 
can't store it as an integer. Use binary(16).

Besides, you don't want to mix IPv4 addresses and IPv6 addresses in the same 
column unless you have another column that keeps track of which kind of 
address it is, but I seem to recall that there is a standard mapping from 
IPv4 addresses to IPv6 addresses, so you could use that and store them all as 
IPv6 addresses.

Björn Persson

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/[EMAIL PROTECTED]

Reply via email to