IP2Location™ LITE IP-COUNTRY-REGION-CITY-LATITUDE-LONGITUDE-ZIPCODE Database

Introduktion

IP2Location LITE Database

Denne database giver en løsning til at bestemme landet, regionen eller staten, byen, breddegrad, længdegrad og postnummer for oprindelsen for enhver IP-adresse i et par enkle trin. Først skal du hente IP-adressen fra netværksprotokollen eller webserverens variabel. Derefter skal du oversætte IP-adressen til et IP-nummer i decimalformat for at fremskynde databaseforespørgslen. Til sidst skal du slå IP-nummeret op fra IP2Location ™ -databasen for at finde den nøjagtige geografiske placering.

Det er gratis til personlig eller kommerciel brug med tilskrivning krævet ved at nævne brugen af ​​disse data som følger,

kommercielle udgave, hvis du leder efter høj datanøjagtighed, flere poster og kundesupport. Besøg produktsammenligningssiden for mere information.

Let's explore this database which provides a valuable resource of geolocation data for free now!

Sign Up For Free

Funktioner

Oversætter IP-adresse til land, region eller stat, by, bredde og længdegrad og US postnummer.

Nuværende version April 2024
Næste opdatering May 2024
IPv4 Databasestørrelse BIN: 81.22 MB
CSV: 303.79 MB (2,979,542 Rækker)
IPv6 Databasestørrelse BIN: 149.62 MB
CSV: 612.11 MB (4,755,690 Rækker)
Array Binær (BIN)
ASCII-tekstfil (CSV)

Databasefelter

Navn Type Beskrivelse
ip_from INT (10) / DECIMAL (39,0)†† Første IP-adresse viser netblock.
ip_to INT (10) / DECIMAL (39,0)†† Sidste IP-adresse viser netblock.
country_code CHAR(2) Landekode med to tegn baseret på ISO 3166.
country_name VARCHAR(64) Landsnavn baseret på ISO 3166.
region_name VARCHAR(128) Region eller statens navn.
city_name VARCHAR(128) Bynavn.
latitude DOUBLE††† Bybreddegrad. Standard til hovedstadens breddegrad, hvis byen er ukendt.
longitude DOUBLE††† Byens længdegrad. Standard til hovedstads længdegrad, hvis byen er ukendt.
zip_code VARCHAR(30) Postnummer.

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.

Databaseopsætning

Nedenfor er trinene til opsætning af databasen til både IPv4- og IPv6-data.

Opret database
CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_db9`(
	`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),
	PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Importér database
LOAD DATA LOCAL
	INFILE 'IP2LOCATION-LITE-DB9.CSV'
INTO TABLE
	`ip2location_db9`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
Opret database
CREATE DATABASE ip2location
GO

USE ip2location
GO

CREATE TABLE [ip2location].[dbo].[ip2location_db9](
	[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
) ON [PRIMARY]
GO

CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_db9]([ip_to]) ON [PRIMARY]
GO
Importér database
BULK INSERT [ip2location].[dbo].[ip2location_db9]
FROM '{PATH TO IP2LOCATION-LITE-DB9.CSV}'
WITH
(
	FORMATFILE = '{PATH TO DB9.FMT}'
)
GO

BEMÆRK: Du bliver nødt til at kopiere FMT-koden nedenfor og gemme den som en fil med navnetDB9.FMT på din computer.

12.0
10
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

Opret database
CREATE DATABASE ip2location WITH ENCODING 'UTF8';
\c ip2location
CREATE TABLE ip2location_db9(
	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,
	CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to)
);
Importér database
COPY ip2location_db9 FROM 'IP2LOCATION-LITE-DB9.CSV' WITH CSV QUOTE AS '"';
Importér database
mongoimport -u USERNAME -p PASSWORD --authenticationDatabase admin --drop --db ip2location --collection ip2location_db9 --type csv --file "IP2LOCATION-LITE-DB9.CSV" --fields ip_from,ip_to,country_code,country_name,region_name,city_name,latitude,longitude,zip_code
Opret database
CREATE DATABASE ip2location;
USE ip2location;
CREATE TABLE `ip2location_db9_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),
	PRIMARY KEY (`ip_to`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
Importér database
LOAD DATA LOCAL
	INFILE 'IP2LOCATION-LITE-DB9.IPV6.CSV'
INTO TABLE
	`ip2location_db9_ipv6`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
Opret database
CREATE DATABASE ip2location
GO

USE ip2location
GO

CREATE TABLE [ip2location].[dbo].[ip2location_db9_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
) ON [PRIMARY]
GO

CREATE CLUSTERED INDEX [ip_to] ON [ip2location].[dbo].[ip2location_db9_ipv6]([ip_to]) ON [PRIMARY]
GO
Importér database
BULK INSERT [ip2location].[dbo].[ip2location_db9_ipv6]
FROM '{PATH TO IP2LOCATION-LITE-DB9.IPV6.CSV}'
WITH
(
	FORMATFILE = '{PATH TO DB9.FMT}'
)
GO

BEMÆRK: Du bliver nødt til at kopiere FMT-koden nedenfor og gemme den som en fil med navnetDB9.FMT på din computer. Den første linje i FMT-koden angiver versionen af ​​bcp. Skift versionen i henhold til din MS-SQL installeret.

12.0
10
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

Opret database
CREATE DATABASE ip2location WITH ENCODING 'UTF8';
\c ip2location
CREATE TABLE ip2location_db9_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,
	CONSTRAINT ip2location_db1_pkey PRIMARY KEY (ip_from, ip_to)
);
Importér database
COPY ip2location_db9_ipv6 FROM 'IP2LOCATION-LITE-DB9.IPV6.CSV' WITH CSV QUOTE AS '"';
Importér database
mongoimport -u USERNAME -p PASSWORD --authenticationDatabase admin --drop --db ip2location --collection ip2location_db9_ipv6 --type csv --file "IP2LOCATION-LITE-DB9.IPV6.CSV" --fields ip_from,ip_to,country_code,country_name,region_name,city_name,latitude,longitude,zip_code

AMI & billeder

IP2Location giver en gratis, forudkonfigureret og klar til at køre AMI og billeder, der let kan opsætte databasen.

Support

Besøg Stack Overflow for at se de tekniske spørgsmål / svar om vores LITE-produkter.

Licens

Gennemse generelle vilkår og betingelser for databaselicenser.

IP2Location™ IP-adresse Geolocation Database

I Commercial Edition får du meget mere end bare IP-adresseopslag:

  • Bedre datanøjagtighed
  • Adgang til opdateret database
  • Yderligere supportniveau via e-mail
Product Upgrade
Sign Up Pop Out

Geolocate Your Visitors Location

Enhance your applications with essential geolocation data by using our FREE databases.