INET6_ATON
Convert an IPv6 address to binary. This function takes an IPv6 (or IPv4) address string and returns it as a VARBINARY(16) string.
Syntax
INET6_ATON(expr)Description
Examples
SELECT HEX(INET6_ATON('10.0.1.1'));
+-----------------------------+
| HEX(INET6_ATON('10.0.1.1')) |
+-----------------------------+
| 0A000101 |
+-----------------------------+
SELECT HEX(INET6_ATON('48f3::d432:1431:ba23:846f'));
+----------------------------------------------+
| HEX(INET6_ATON('48f3::d432:1431:ba23:846f')) |
+----------------------------------------------+
| 48F3000000000000D4321431BA23846F |
+----------------------------------------------+See Also
Last updated
Was this helpful?

