473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Data type for IP Address converted using INET_ATON()

Is it INT(10)? I've done some reading and found out that INET_ATON() should make my MySQL queries fastest, but I'm not sure which data type to store it as.

As far as I can tell, the maximum value should be: 255×256^3 + 255×256^2 + 255×256^1 + 255 = 4278190080 + 16711680 + 65280 + 255 = 4,294,967,295

Which means that the best (fastest) data type would be INT(10) UNSIGNED. Am I right?
Aug 24 '07 #1
6 8030
Yes/No?

Sorry i just want to get this right.
Aug 25 '07 #2
Atli
5,058 Expert 4TB
The best match for that would be a simple INT UNSIGNED.

The INT type is 4 bytes which according to my calculations, and the MySQL reference manual, has a max value of 4,294,967,295 when it is UNSIGNED.

The extra (10) to the INT would do nothing but allow the extra 5.71 billion to be stored as well.
Aug 26 '07 #3
I don't think phpmyadmin lets you specify INT without a length does it?
Aug 26 '07 #4
Atli
5,058 Expert 4TB
I don't think phpmyadmin lets you specify INT without a length does it?
I don't know, but not allowing it would be a major flaw. In any case, you could always simply write the query yourself and then run it.
Aug 26 '07 #5
Alright, cool. Thanks man.
Aug 26 '07 #6
pbmods
5,821 Expert 4TB
Heya, Psycho.

I don't think phpmyadmin lets you specify INT without a length does it?
Sure it does.

VARCHAR and CHAR types do require a length, but numeric types are inherently limited.
Aug 26 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Randell D. | last post by:
Folks, Perhaps someone can figure this out - this is 'the process of my script' I have a form whereby I can add multiple contacts to a single address. There is only one...
1
by: Brent | last post by:
I store IP addresses using the INET_ATON function, e.g. INSERT INTO myTable(IP_Address) Values (INET_ATON(123.123.33.12)); I would like to create a daily report that groups IP addresses by a...
32
by: Neil Ginsberg | last post by:
We're using SQL Server 7 with an Access 2000 MDB as a front end with ODBC linked tables. I recently created a new set of tables for the app, and users are complaining that unsaved data is being...
3
by: rdraider | last post by:
I'm doing a data conversion project, moving data from one SQL app to another. I'm using INSERT INTO with Select and have the syntax correct. But when executing the script I get: Server: Msg...
5
by: Alfonso Morra | last post by:
Hi, I am writing a messaging library which will allow me to send a generic message structure with custom "payloads". In many cases, a message must store a non-linear data structure (i.e....
9
by: MR | last post by:
I get the following Exception "The data at the root level is invalid. Line 1, position 642" whenever I try to deserialize an incoming SOAP message. The incoming message is formed well and its...
5
by: DBQueen | last post by:
I have a database where the user will have the opportunity to set up a number of Tests. I want the user to be able to enter the equation if a field for a particular test is to be a calculated...
2
by: BruceWho | last post by:
Hi, all I used inet_aton in my Visual C++ application, but got an error: error C2065: 'inet_aton' : undeclared identifier I searched the web and it seems that Visual C++ doesn't have...
0
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.