0

MySQL documentation says that: Data type VARBINARY(16) is for IPv6 addresses and data type VARBINARY(4) is for IPv4 addresses.

But when I try to store INET_ATON result to VARBINARY(4) column, I get the following error message:

Data too long for column varbinary(4)

Storing INET_ATON result to VARBINARY(16) is OK!

What's wrong?

NoSkill
  • 718
  • 5
  • 15

1 Answers1

1

From the said INET_ATON's documentation:

To store values generated by INET_ATON(), use an INT UNSIGNED column (…)

Mike Doe
  • 16,349
  • 11
  • 65
  • 88