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

Invoering

IP2Location LITE Database

Deze database biedt een oplossing om in een paar eenvoudige stappen het land, de regio of de staat, de stad, de breedtegraad, de lengtegraad en de postcode van herkomst te bepalen voor elk IP-adres. Haal eerst het IP-adres op uit het netwerkprotocol of de variabele aan de serverzijde van de webserver. Vertaal vervolgens het IP-adres naar een IP-nummer in decimaal formaat om de databasequery te versnellen. Zoek ten slotte het IP-nummer van de IP2Location ™ -database omgekeerd op om de exacte geografische locatie te bepalen.

Het is gratis voor persoonlijk of commercieel gebruik met attributie vereist door het gebruik van deze gegevens als volgt te vermelden:

Download de commerciële editie als u op zoek bent naar een hoge gegevensnauwkeurigheid, meer records en klantenondersteuning. Bezoek de productvergelijkingspagina voor meer informatie.

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

Sign Up For Free

Kenmerken

Vertaalt IP-adres naar land, regio of staat, stad, lengte- en breedtegraad en Amerikaanse postcode.

Huidige versie March 2024
Volgende Update April 2024
IPv4 Database grootte BIN: 81.33 MB
CSV: 304.27 MB (2,983,740 Rijen)
IPv6 Database grootte BIN: 146.97 MB
CSV: 602.06 MB (4,687,620 Rijen)
Array Binair (BIN)
ASCII-tekstbestand (CSV)

Databasevelden

Naam Type Omschrijving
ip_from INT (10) / DECIMAL (39,0)†† Eerste IP-adres toont netblock.
ip_to INT (10) / DECIMAL (39,0)†† Laatste IP-adres toont netblock.
country_code CHAR(2) Landcode van twee tekens op basis van ISO 3166.
country_name VARCHAR(64) Landnaam gebaseerd op ISO 3166.
region_name VARCHAR(128) Naam van regio of staat.
city_name VARCHAR(128) Stads naam.
latitude DOUBLE††† Breedtegraad van de stad. Standaard de breedtegraad van de hoofdstad als de stad onbekend is.
longitude DOUBLE††† Lengtegraad van de stad. Standaard de lengtegraad van de hoofdstad als de stad onbekend is.
zip_code VARCHAR(30) Postcode.

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.

Database instellen

Hieronder staan ​​de stappen om de database in te stellen voor zowel IPv4- als IPv6-gegevens.

Maak een 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;
Database importeren
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;
Maak een 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
Database importeren
BULK INSERT [ip2location].[dbo].[ip2location_db9]
FROM '{PATH TO IP2LOCATION-LITE-DB9.CSV}'
WITH
(
	FORMATFILE = '{PATH TO DB9.FMT}'
)
GO

OPMERKING: u moet de onderstaande FMT-code kopiëren en deze op uw computer opslaan als een bestand met de naamDB9.FMT.

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

Maak een 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)
);
Database importeren
COPY ip2location_db9 FROM 'IP2LOCATION-LITE-DB9.CSV' WITH CSV QUOTE AS '"';
Database importeren
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
Maak een 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;
Database importeren
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;
Maak een 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
Database importeren
BULK INSERT [ip2location].[dbo].[ip2location_db9_ipv6]
FROM '{PATH TO IP2LOCATION-LITE-DB9.IPV6.CSV}'
WITH
(
	FORMATFILE = '{PATH TO DB9.FMT}'
)
GO

OPMERKING: u moet de onderstaande FMT-code kopiëren en deze op uw computer opslaan als een bestand met de naamDB9.FMT. De eerste regel van de FMT-code geeft de versie van bcp aan. Wijzig de versie volgens uw geïnstalleerde MS-SQL.

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

Maak een 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)
);
Database importeren
COPY ip2location_db9_ipv6 FROM 'IP2LOCATION-LITE-DB9.IPV6.CSV' WITH CSV QUOTE AS '"';
Database importeren
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 & afbeeldingen

IP2Location biedt een gratis, vooraf geconfigureerde en gebruiksklare AMI en afbeeldingen om de database eenvoudig op te zetten.

Ondersteuning

Ga naar Stack Overflow om de technische vragen / antwoorden over onze LITE-producten te bekijken.

Licentie

Raadpleeg de algemene voorwaarden voor de databaselicenties.

IP2Location™ IP-adres Geolocatiedatabase

In de Commercial Edition krijgt u veel meer dan alleen het opzoeken van IP-adressen:

  • Betere gegevensnauwkeurigheid
  • Toegang tot up-to-date database
  • Extra ondersteuning 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.