Home > Uncategorized > Import CVS data to MySQL table

Import CVS data to MySQL table

Import OpenGEO csv file into mysql.

Table structure:

id	int(11) Auto Increment	 
ip_start	int(11)	 
ip_end	int(11)	 
miasto	text	 
powiat	text	 
wojewodztwo	text

File structure:

"IP START","IP END","MIASTO","POWIAT","WOJEWÓDZTWO"
522815488,522817535,"Wieluń","wieluński","Łódzkie"
(...)

MySQL command:

mysql> load data local infile '/home/user/opengeo.csv' into table opengeo fields terminated by ',' enclosed by '"' lines terminated by '\n' (ip_start, ip_end, miasto, powiat, wojewodztwo);
Query OK, 71513 rows affected, 4594 warnings (0.56 sec)
Records: 71513  Deleted: 0  Skipped: 0  Warnings: 4592
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: