If you want to store IPv4 addresses, you can save them in a 32-bit integer field.
If you want to also support IPv6, then the string is probably the easiest to read / used way (although you can technically save them in a 16-byte VARBINARY() field, it would be very unpleasant to try to generate SQL statements to select by IP address "manually")
Dean Harding Mar 29 '10 at 23:56 2010-03-29 23:56
source share