我已经从那里的网站Country database CSV下载了 maxmind country 数据库。现在我想在 mysql 数据库中安装这个数据库。我阅读了文档页面上给出的说明,但我很困惑。如何在mysql数据库中安装这个数据库?
这是我尝试过的东西..
CREATE DATABASE geoip;
USE geoip;
CREATE TABLE geocountry (
start_ip CHAR(15) NOT NULL,
end_ip CHAR(15) NOT NULL,
start_long INT UNSIGNED NOT NULL,
end_long INT UNSIGNED NOT NULL,
country_code CHAR(2) NOT NULL,
country_name VARCHAR(50) NOT NULL
);
LOAD DATA LOCAL INFILE 'C:\\Users\\user\\Desktop\\geocountry.csv'
INTO TABLE geocountry
FIELDS TERMINATED BY ','
LINES TERMINATED BY '\n'
(start_ip, end_ip, start_long,end_long,country_code,country_name);