Go Back   CodingForums.com > :: Server side development > MySQL

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 04-21-2012, 05:35 PM   PM User | #1
jamhussain
New Coder

 
Join Date: Apr 2012
Posts: 12
Thanks: 2
Thanked 0 Times in 0 Posts
jamhussain is an unknown quantity at this point
Post link

I m new in mysql.
I have a csv or xml file having fields
country name, birth rate, year,

i want to upload this file into mysql database.
can anybody provide me link to solve this problem
thanks.
jamhussain is offline   Reply With Quote
Old 04-23-2012, 08:07 PM   PM User | #2
Old Pedant
Supreme Master coder!

 
Old Pedant's Avatar
 
Join Date: Feb 2009
Posts: 23,200
Thanks: 59
Thanked 3,996 Times in 3,965 Posts
Old Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to allOld Pedant is a name known to all
http://dev.mysql.com/doc/refman/5.1/en/load-data.html

CSV will be easier than XML.

One *POSSIBLE* example:
Code:
LOAD DATA INFILE '...your file name'
INTO TABLE ...yourTableName...
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
That should work for a CSV file that looks something like
Code:
"England",1.03,2001
"France",0.97,2001
etc.
__________________
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Old Pedant is offline   Reply With Quote
Reply

Bookmarks

Tags
link

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 07:57 PM.


Advertisement
Log in to turn off these ads.