From: Date: November 11 2005 9:43pm Subject: Re: Best Fieldtype to store IP address... List-Archive: http://lists.mysql.com/cluster/2781 Message-Id: <43750268.40401@ca.mci.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit The same way the kernel deals with them; int(10) unsigned. To convert a dotted quad string into int(10) use the following: Using 192.168.10.50: 192 + (168 * 2^8) + (10 * 2^16) + (50 * 2^24) = 839559360 This is real handy if you're doing low level socket stuff and storing addresses in the database. -Evan Cory @ SkyVantage wrote: > I'm using MySQL-Cluster 5.0, and we're doing some research. > What is everyone's opinion as to what the best fieldtype to store an IP > address in? > > varchar(16) ? because 16 is the max chars of an ip address... > char(16) ? > text(16) > > Not quite sure how to get the best memory utilization... > >