How to import data from csv files into database?

Discussion in 'Databases' started by hhheng, Jul 9, 2007.

  1. #1
    In phpMyAdmin, I tried to use the import function to import huge list of data (saved as .csv file) into my database. But every time I will have errors like:

    • Invalid parameter for CSV import: Lines terminated by
    • Invalid parameter for CSV import: Fields terminated by
    • Invalid parameter for CSV import: Fields escaped by
    • Invalid parameter for CSV import: Fields enclosed by

    How to import data from .csv files? How to set the format to avoid above problems?

    Is there any other easy ways to import data from Excel file into sql database?
     
    hhheng, Jul 9, 2007 IP
  2. tamilsoft

    tamilsoft Banned

    Messages:
    1,155
    Likes Received:
    78
    Best Answers:
    0
    Trophy Points:
    0
    #2
    If you have a proper CSV format, try this query

    LOAD DATA INFILE 'yourfilename.csv' INTO TABLE `yourtablename` FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n'
    PHP:
     
    tamilsoft, Jul 9, 2007 IP
  3. hulkrana

    hulkrana Member

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #3
    hello frds,

    i want to download oracle sql*plus online.please suggest me how it colud be possible.

    thanks and regards
     
    hulkrana, Jul 13, 2007 IP
  4. hulkrana

    hulkrana Member

    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    hello frds,

    i want to download oracle sql*plus online.please suggest me how it colud be possible.

    thanks and regards
    Reply With Quote
     
    hulkrana, Jul 13, 2007 IP