Collections:
IS_IPV4() - Detecting IPv4 Address
How to detect an IPv4 Address using the IS_IPV4() function?
✍: FYIcenter.com
IS_IPV4(ip) is a MySQL built-in function that
returns 1 if the given value is a valid IPv4 address, 0 otherwise.
For example:
SELECT IS_IPV4('10.0.5.9'), IS_IPV4('10.0.5.256');
-- +---------------------+-----------------------+
-- | IS_IPV4('10.0.5.9') | IS_IPV4('10.0.5.256') |
-- +---------------------+-----------------------+
-- | 1 | 0 |
-- +---------------------+-----------------------+
Reference information of the IS_IPV4() function:
IS_IPV4(ip): boolean
Returns 1 if and only if the argument is a valid IPv4 address.
Arguments, return value and availability:
ip: Required. The IP address to be examined.
boolean: Return value.
1 if and only if the argument is a valid IPv4 address.
Available since MySQL 4.0.
Related MySQL functions:
⇒ IS_IPV4_COMPAT() - IPv4-Compatible IPv6 Address
⇐ IS_FREE_LOCK() - Checking Lock Status
2026-02-02, 3682🔥, 0💬
Popular Posts:
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
How To Convert Numeric Expression Data Types using the CAST() Function in SQL Server Transact-SQL? I...
How To Use "IF ... ELSE IF ..." Statement Structures in SQL Server Transact-SQL? "IF ... ELSE IF ......
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...
What Are the Differences between BINARY and VARBINARY in MySQL? Both BINARY and VARBINARY are both b...