> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# inet_aton

> 获取包含IPv4地址的字符串并返回相应的大端BIGINT数字。

获取包含 IPv4 地址的字符串，格式为 A.B.C.D。返回一个 BIGINT 数字，表示相应的大端 IPv4 地址。

## 语法

```Haskell theme={null}
inet_aton(VARCHAR ipv4)
```

## 参数说明

`str`: 支持的数据类型为 VARCHAR。

## 返回值说明

返回值的数据类型为 BIGINT。

## 示例

```Plain Text theme={null}
mysql> select inet_aton('192.168.1.1'); 
+--------------------------------------+ 
| inet_aton('192.168.1.1')             | 
+--------------------------------------+ 
| 3232235777                           | 
+--------------------------------------+ 

mysql> select stringIp, inet_aton(stringIp) from ipv4; 
+-----------------+----------------------------+ 
|stringIp         | inet_aton(stringIp)        | 
+-----------------+----------------------------+ 
| 0.0.0.0         | 0                          | 
| 255.255.255.255 | 4294967295                 | 
| invalid         | NULL                       | 
+-----------------+----------------------------+ 
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.