Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2

Thread: link

  1. #1
    New Coder
    Join Date
    Apr 2012
    Posts
    12
    Thanks
    2
    Thanked 0 Times in 0 Posts

    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.

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,166
    Thanks
    75
    Thanked 4,338 Times in 4,304 Posts
    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.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •