Conversion
MySQL
INET_NTOA
Mengkonversi unsigned integer ke IPv4 address string. Kebalikan dari INET_ATON().
Tipe hasil:
VARCHAR(15)Diperbarui: 7 Jan 2026Syntax
SQL
INET_NTOA(ip_int)Parameter
ip_intBIGINT UNSIGNEDwajib
IP address sebagai integer
Contoh Penggunaan
Convert Integer to IP
SQL
1 SELECT INET_NTOA(3232235876) AS ip_str;
Konversi integer ke IP string.
Hasil
ip_str: 192.168.1.100
Display IP Logs
SQL
1 SELECT INET_NTOA(ip_address) AS ip, 2 access_time 3 FROM access_logs 4 ORDER BY access_time DESC;
Display IP addresses yang tersimpan.
Hasil
(readable IP addresses)
Export with IP Strings
SQL
1 SELECT user_id, 2 INET_NTOA(last_ip) AS last_ip_address, 3 last_login 4 FROM users;
Export data dengan readable IP.
Hasil
(data with IP strings)