Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 2009
    Posts
    4

    Unanswered: create sql query

    Hi,
    I have some data in csv file which i need to upload to mysql database( phphmyadmin). How can i convert this csv to sql insert query ? Thanks for your help.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    doesn't phpmyadmin have an Import tab? i can't recall for sure -- i know it has Browse, SQL, Export ...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    PHPMyAdmin can accept many different types of import, CSV being one of them
    I'd rather be riding on the Tiger 800 or the Norton

  4. #4
    Join Date
    Jul 2009
    Posts
    4

    thanks

    I have always used MS SQL and was expecting this here too. But when i click on import from my phpadmin it shows three things - one is browse button to upload file and second is option to allow partial import and then third is format of imported file which is already set to sql and a message is there- this format has no options. So i thought it might be accepting only sql files. But how can i upload csv if it does not accept this format. PLease help. Maybe there is another way to do it.

  5. #5
    Join Date
    Nov 2004
    Location
    out on a limb
    Posts
    13,692
    Provided Answers: 59
    ok so theres other possible alterntives
    one use the MySQL migration toolkit fromt he MyQL website to import data from MS SQL server
    use the MYSQL commnad line client and issue a load directive
    LOAD DATA INFILE "csvfile.csv" INTO TABLE tablename FIELDS TERMINATED BY ',';

    use third party too such as dbtools

    write a quick and dirty import program
    I'd rather be riding on the Tiger 800 or the Norton

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by dineshthakur
    But when i click on import from my phpadmin it shows three things - one is browse button to upload file
    the csv would be imported with this option
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Jul 2009
    Posts
    4

    i tried this

    No this data is not in sql. I got it in csv. 100k rows ! I need to find a way to insert this data to mysql through phpmyadmin. And i think the best way is to generate sql and zip it and then upload( i may even need to split the data if filesize still exceeds limit to upload).
    I tried to import csv but it gives sql error.

  8. #8
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by dineshthakur
    I tried to import csv but it gives sql error.
    oh, yes, i am familiar with that error

    it is either the geflittende error or the verplunken error

    you need to adjust the framistan on the phpmyadmin control panel
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

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