If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > create sql query

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-11-09, 04:11
dineshthakur dineshthakur is offline
Registered User
 
Join Date: Jul 2009
Posts: 4
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.
Reply With Quote
  #2 (permalink)  
Old 07-11-09, 05:09
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
doesn't phpmyadmin have an Import tab? i can't recall for sure -- i know it has Browse, SQL, Export ...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 07-11-09, 06:14
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,260
PHPMyAdmin can accept many different types of import, CSV being one of them
__________________
I'd rather be riding my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #4 (permalink)  
Old 07-11-09, 07:30
dineshthakur dineshthakur is offline
Registered User
 
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.
Reply With Quote
  #5 (permalink)  
Old 07-11-09, 07:50
healdem healdem is online now
Jaded Developer
 
Join Date: Nov 2004
Location: out on a limb
Posts: 9,260
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 my Versys or my Tiger 800 let alone the Norton
Reply With Quote
  #6 (permalink)  
Old 07-11-09, 09:50
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 07-11-09, 13:31
dineshthakur dineshthakur is offline
Registered User
 
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.
Reply With Quote
  #8 (permalink)  
Old 07-11-09, 14:40
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On