Page 1 of 1

uploading data to a database

Posted: Mon Feb 13, 2017 9:27 am
by Vegan
I have 2 CSV files uploaded to my Linux VM, one is IPv4 and the other is IPv2 and I have 2 tables for them respectively.

The purpose is to be able to build a better ad rotator for global internet traffic

IPv4:

Code: Select all

LOAD DATA LOCAL
	INFILE 'IP2LOCATION-LITE-DB1.CSV'
INTO TABLE
	`ip2location_db1`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
IPv6:

Code: Select all

LOAD DATA LOCAL
	INFILE 'IP2LOCATION-LITE-DB1.IPV6.CSV'
INTO TABLE
	`ip2location_db1_ipv6`
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\r\n'
IGNORE 0 LINES;
So any ideas on how to update the database dynamically? I was considering mostly IPv4 until IPv6 becomes more widely available.

For now I have them manually setup, but eventually I wanted to use JavaScript and correct the database with a POST command os something

databases are not too large, 24,000 rows for IPv6 is easy to manage