开发者

How should ip2long converted IP's be stored in MySQL?

开发者 https://www.devze.com 2023-03-01 13:44 出处:网络
I don\'t know enough about the function, or ip\'s, to determine how my col开发者_运维技巧umn structure should be for storing this. Any suggestions?Simply use an unsigned INT field for it.

I don't know enough about the function, or ip's, to determine how my col开发者_运维技巧umn structure should be for storing this. Any suggestions?


Simply use an unsigned INT field for it.

Also see http://lists.mysql.com/cluster/2781 for a discussion about it.


Using INT is fine when you're dealing with IPv4 addresses. However 128-bits long IPv6 can't be stored as INT or even BIGINT.

  1. How to store IPv6-compatible address in a relational database
  2. How to convert IPv6 from binary for storage in MySQL
  3. http://www.google.com/search?client=opera&rls=en&q=storing+ipv6+mysql&sourceid=opera&ie=utf-8&oe=utf-8
0

精彩评论

暂无评论...
验证码 换一张
取 消