ID EN
Miscellaneous Functions

INET_ATON(expr)

MySQL 8.4

Given the dotted-quad representation of an IPv4 network address as a string, returns an integer that represents the numeric value of the address in network byte order (big endian). INET_ATON() returns NULL if it does not understand its argument, or if expr is NULL.

Syntax

MYSQL
SELECT INET_ATON('10.0.5.9');
167773449

Examples

Example

For this example, the return value is calculated as 10×2563 + 0×2562 + 5×256 + 9.

MYSQL
SELECT INET_ATON('10.0.5.9');
167773449