IP addresses stored in MYSQL are often stored in the VARCHAR (15) column. However, they are actually 32-bit unsigned integers, not strings. The expression of dividing an address into four decimal points is only used to make reading easier. Therefore, you should use an unsigned integer to store IP addresses. MySQL provides the INET_ATON () and INET_NTOA () functions in these two tables.
IP addresses stored in MYSQL are often stored in the VARCHAR (15) column. However, they are actually 32-bit unsigned integers, not strings. The expression of dividing an address into four decimal points is only used to make reading easier. Therefore, you should use an unsigned integer to store IP addresses. MySQL provides the INET_ATON () and INET_NTOA () functions in these two tables.
MYSQL storage IP Address
IP addresses are frequently stored in the VARCHAR (15) column.
However, they are actually 32-bit unsigned integers, not strings.
The expression of dividing an address into four decimal points is only used to make reading easier.
Therefore, you should use an unsigned integer to store IP addresses.
MySQL provides the INET_ATON () and INET_NTOA () functions to convert between the two representation methods.