Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

1 - Log into MySQL console

You have to use mysql command with --local-info=1 to login, e.g.

Code Block
mysql --local-infile=1 -uroot -p dualshield

Image Added

2 - Change to "DualShield" database:

Code Block
languagesql
mysql > use DualShield;

Image Added

3 - Set local_infile variable

Code Block
languagesql
mysql > set global local_infile=true;

Image Added

4 - Execute the script below to import the database

Code Block
languagesql
mysql > LOAD DATA LOCAL INFILE 'FILE-PATH-TO\\IP2LOCATION-LITE-DB3DB5.CSV' INTO TABLE ip2location_db3
FIELDS TERMINATED BY ',' ENCLOSED BY '"'
LINES TERMINATED BY '\r\n' 
IGNORE 0 LINES (ip_from,ip_to,country_code,country_name,region_name,city_name,latitude,longitude);

* replace "FILE-PATH-TO" with the actual file path where the downloaded file is saved, e.g. "C:\\Temp"

Image Removed

Please note that it can take about 30 minutes to import the data.Image Removed

Image Added





Note:

* For dualshield version < 8.0, the name of the table in the database is called "ip2location_db3"