Pangkalan data ini menyediakan penyelesaian untuk menentukan negara, wilayah atau negeri, kota, garis lintang, garis bujur, kod ZIP dan zon waktu asal untuk mana-mana alamat IP dalam beberapa langkah mudah. Pertama, dapatkan alamat IP dari protokol rangkaian atau pemboleh ubah sisi pelayan Web. Seterusnya, terjemahkan alamat IP ke nombor IP dalam format perpuluhan untuk mempercepat pertanyaan pangkalan data. Terakhir, cari semula nombor IP dari pangkalan data IP2Location ™ untuk menentukan lokasi geografi yang tepat.
Ia percuma untuk penggunaan peribadi atau komersial dengan atribusi yang diperlukan dengan menyebut penggunaan data ini sebagai berikut,
Dapatkan edisi komersial jika anda mencari ketepatan data yang tinggi, lebih banyak rekod & sokongan pelanggan. Sila lawati halaman perbandingan produk untuk maklumat lebih lanjut.
Let's explore this database which provides a valuable resource of geolocation data for free now!
Sign Up For FreeMenerjemahkan alamat IP ke negara, wilayah atau negeri, bandar, garis lintang dan garis bujur, poskod AS dan zon waktu.
Versi terkini | December 2024 |
---|---|
Kemas Kini Seterusnya | January 2025 |
IPv4 Saiz Pangkalan Data |
BIN: 91.15 MB CSV: 323.1 MB (2,931,409 Baris) |
IPv6 Saiz Pangkalan Data |
BIN: 185.35 MB CSV: 720.74 MB (5,160,799 Baris) |
Array |
Binari (BIN)
Fail Teks ASCII (CSV) |
Nama | Jenis | Penerangan |
---|---|---|
ip_from | INT (10)† / DECIMAL (39,0)†† | Alamat IP pertama menunjukkan sekatan bersih. |
ip_to | INT (10)† / DECIMAL (39,0)†† | Alamat IP terakhir menunjukkan sekatan bersih. |
country_code | CHAR(2) | Kod negara dua watak berdasarkan ISO 3166. |
country_name | VARCHAR(64) | Nama negara berdasarkan ISO 3166. |
region_name | VARCHAR(128) | Nama wilayah atau negeri. |
city_name | VARCHAR(128) | Nama bandar. |
latitude | DOUBLE††† | Lintang bandar. Lalai ke lintang ibu kota jika bandar tidak diketahui. |
longitude | DOUBLE††† | Bujur bandar. Lalai ke garis bujur ibu kota jika bandar tidak diketahui. |
zip_code | VARCHAR(30) | Poskod. |
time_zone | VARCHAR(8) | Zon waktu UTC (dengan DST disokong). Sekiranya anda mencari Zon Waktu Olson, sila kunjungi di sini. |
† IPv4
†† IPv6
††† Latitude and Longitude are often near the center of population. These values are not precise and should not be used to identify a particular address or household.
Berikut adalah langkah-langkah untuk menyediakan pangkalan data untuk data IPv4 dan IPv6.
CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_db11`(
`ip_from` INT(10) UNSIGNED,
`ip_to` INT(10) UNSIGNED,
`country_code` CHAR(2),
`country_name` VARCHAR(64),
`region_name` VARCHAR(128),
`city_name` VARCHAR(128),
`latitude` DOUBLE,
`longitude` DOUBLE,
`zip_code` VARCHAR(30),
`time_zone` VARCHAR(8),
PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
LOAD DATA LOCAL
INFILE 'IP2LOCATION-LITE-DB11.CSV'
INTO TABLE
`ip2location_db11`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
CREATE DATABASE ip2location
GO
USE ip2location
GO
CREATE TABLE [ip2location].[dbo].[ip2location_db11](
[ip_from] bigint NOT NULL,
[ip_to] bigint NOT NULL,
[country_code] nvarchar(2) NOT NULL,
[country_name] nvarchar(64) NOT NULL,
[region_name] nvarchar(128) NOT NULL,
[city_name] nvarchar(128) NOT NULL,
[latitude] float NOT NULL,
[longitude] float NOT NULL,
[zip_code] nvarchar(30) NOT NULL,
[time_zone] nvarchar(8) NOT NULL
) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_db11]([ip_to]) ON [PRIMARY]
GO
BULK INSERT [ip2location].[dbo].[ip2location_db11]
FROM '{PATH TO IP2LOCATION-LITE-DB11.CSV}'
WITH
(
FORMATFILE = '{PATH TO DB11.FMT}'
)
GO
CATATAN: Anda perlu menyalin kod FMT di bawah dan menyimpannya sebagai fail bernamaDB11.FMT di komputer anda.
12.0
11
1 SQLCHAR 0 1 "\"" 0 first_double_quote Latin1_General_CI_AI
2 SQLCHAR 0 20 "\",\"" 1 ip_from "",
3 SQLCHAR 0 20 "\",\"" 2 ip_to "",
4 SQLCHAR 0 2 "\",\"" 3 country_code Latin1_General_CI_AI,
5 SQLCHAR 0 64 "\",\"" 4 country_name Latin1_General_CI_AI,
6 SQLCHAR 0 128 "\",\"" 5 region_name Latin1_General_CI_AI,
7 SQLCHAR 0 128 "\",\"" 6 city_name Latin1_General_CI_AI,
8 SQLCHAR 0 20 "\",\"" 7 latitude "",
9 SQLCHAR 0 20 "\",\"" 8 longitude "",
10 SQLCHAR 0 30 "\",\"" 9 zip_code Latin1_General_CI_AI,
11 SQLCHAR 0 8 "\"\r\n" 10 time_zone Latin1_General_CI_AI
CREATE DATABASE ip2location WITH ENCODING 'UTF8';
\c ip2location
CREATE TABLE ip2location_db11(
ip_from bigint NOT NULL,
ip_to bigint NOT NULL,
country_code character(2) NOT NULL,
country_name character varying(64) NOT NULL,
region_name character varying(128) NOT NULL,
city_name character varying(128) NOT NULL,
latitude real NOT NULL,
longitude real NOT NULL,
zip_code character varying(30) NOT NULL,
time_zone character varying(8) NOT NULL,
CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to)
);
COPY ip2location_db11 FROM 'IP2LOCATION-LITE-DB11.CSV' WITH CSV QUOTE AS '"';
mongoimport -u USERNAME -p PASSWORD --authenticationDatabase admin --drop --db ip2location --collection ip2location_db11 --type csv --file "IP2LOCATION-LITE-DB11.CSV" --fields ip_from,ip_to,country_code,country_name,region_name,city_name,latitude,longitude,zip_code,time_zone
CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_db11_ipv6`(
`ip_from` DECIMAL(39,0) UNSIGNED,
`ip_to` DECIMAL(39,0) UNSIGNED,
`country_code` CHAR(2),
`country_name` VARCHAR(64),
`region_name` VARCHAR(128),
`city_name` VARCHAR(128),
`latitude` DOUBLE,
`longitude` DOUBLE,
`zip_code` VARCHAR(30),
`time_zone` VARCHAR(8),
PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
LOAD DATA LOCAL
INFILE 'IP2LOCATION-LITE-DB11.IPV6.CSV'
INTO TABLE
`ip2location_db11_ipv6`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
CREATE DATABASE ip2location
GO
USE ip2location
GO
CREATE TABLE [ip2location].[dbo].[ip2location_db11_ipv6](
[ip_from] char(39) NOT NULL,
[ip_to] char(39) NOT NULL,
[country_code] nvarchar(2) NOT NULL,
[country_name] nvarchar(64) NOT NULL,
[region_name] nvarchar(128) NOT NULL,
[city_name] nvarchar(128) NOT NULL,
[latitude] float NOT NULL,
[longitude] float NOT NULL,
[zip_code] nvarchar(30) NOT NULL,
[time_zone] nvarchar(8) NOT NULL
) ON [PRIMARY]
GO
CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_db11_ipv6]([ip_to]) ON [PRIMARY]
GO
BULK INSERT [ip2location].[dbo].[ip2location_db11_ipv6]
FROM '{PATH TO IP2LOCATION-LITE-DB11.IPV6.CSV}'
WITH
(
FORMATFILE = '{PATH TO DB11.FMT}'
)
GO
CATATAN: Anda perlu menyalin kod FMT di bawah dan menyimpannya sebagai fail bernamaDB11.FMT di komputer anda. Baris pertama kod FMT menunjukkan versi bcp. Tolong ubah versi sesuai dengan MS-SQL yang anda pasang.
12.0
11
1 SQLCHAR 0 1 "\"" 0 first_double_quote Latin1_General_CI_AI
2 SQLCHAR 0 39 "\",\"" 1 ip_from "",
3 SQLCHAR 0 39 "\",\"" 2 ip_to "",
4 SQLCHAR 0 2 "\",\"" 3 country_code Latin1_General_CI_AI,
5 SQLCHAR 0 64 "\",\"" 4 country_name Latin1_General_CI_AI,
6 SQLCHAR 0 128 "\",\"" 5 region_name Latin1_General_CI_AI,
7 SQLCHAR 0 128 "\",\"" 6 city_name Latin1_General_CI_AI,
8 SQLCHAR 0 20 "\",\"" 7 latitude "",
9 SQLCHAR 0 20 "\",\"" 8 longitude "",
10 SQLCHAR 0 30 "\",\"" 9 zip_code Latin1_General_CI_AI,
11 SQLCHAR 0 8 "\"\r\n" 10 time_zone Latin1_General_CI_AI
CREATE DATABASE ip2location WITH ENCODING 'UTF8';
\c ip2location
CREATE TABLE ip2location_db11_ipv6(
ip_from decimal(39,0) NOT NULL,
ip_to decimal(39,0) NOT NULL,
country_code character(2) NOT NULL,
country_name character varying(64) NOT NULL,
region_name character varying(128) NOT NULL,
city_name character varying(128) NOT NULL,
latitude real NOT NULL,
longitude real NOT NULL,
zip_code character varying(30) NOT NULL,
time_zone character varying(8) NOT NULL,
CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to)
);
COPY ip2location_db11_ipv6 FROM 'IP2LOCATION-LITE-DB11.IPV6.CSV' WITH CSV QUOTE AS '"';
mongoimport -u USERNAME -p PASSWORD --authenticationDatabase admin --drop --db ip2location --collection ip2location_db11_ipv6 --type csv --file "IP2LOCATION-LITE-DB11.IPV6.CSV" --fields ip_from,ip_to,country_code,country_name,region_name,city_name,latitude,longitude,zip_code,time_zone
IP2Location menyediakan AMI dan gambar percuma, pra-konfigurasi & siap dijalankan untuk menyediakan pangkalan data dengan mudah.
Enhance your applications with essential geolocation data by using our FREE databases.