WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Database Discussion Forum This is the place to find help resolving those nagging questions you have about implementing and using all kinds of databases. Need help writing a query? Need an opinion on Oracle? Post here!

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-03-2005, 12:53 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default CSV to mySQL

I have a CSV file I spun out from MS Excel that I would like to put in a mySQL table. I use two hosts that have different versions of phpMyAdmin and one host does not have the CSV upload option. Is there software (preferable FREE) out there that converts CSV files into mySQL table create queries so I can upload this file on the host that does not support the CSV upload?

Thanks,

Rich
Reply With Quote
  #2 (permalink)  
Old 06-03-2005, 03:36 PM
brian.mark's Avatar
brian.mark brian.mark is offline
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default Ever used...

Ever used mysqlfront? I've used it for that purpose in the past.

They have a 30 day trial posted here:

http://www.mysqlfront.de/download.html

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #3 (permalink)  
Old 06-03-2005, 03:57 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

I believe this program requires mySQL to be installed on my computer. I don't have a mySQL server installed on my machine. I use the servers at GoDaddy.com.

Isn't there a simple converter that takes CSV data and converts it into a table insert query that I can copy and paste into myPHPAdmin?

Thanks,

Rich

p.s. Since GoDaddy.com uses a fairly new copy of myPHPAdmin is seems like they should have a csv upload option. Am I missing something? Thanks.
Reply With Quote
  #4 (permalink)  
Old 06-03-2005, 04:28 PM
brian.mark's Avatar
brian.mark brian.mark is offline
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default I don't have mySQL server on my PC

I use that and don't have the server program on my PC. It connects via the net to our databases just fine.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #5 (permalink)  
Old 06-03-2005, 04:34 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

Thanks for letting me know. I'll try it out.

Rich
Reply With Quote
  #6 (permalink)  
Old 06-30-2005, 01:04 PM
richkoi's Avatar
richkoi richkoi is offline
WebProWorld Veteran
 

Join Date: Aug 2003
Location: Columbus, Ohio
Posts: 487
richkoi RepRank 0
Default

mysqlfront works great... Except GoDaddy.com does not allow access from anything but their web access portal!

Right now I am using another host to create my tables and then exporting them to .sql files and then importing them using the GoDaddy webportal.

What would work much better for me is if I could use localhost to do this. I tried installing mySQL and PHP on my Windows XP pro machine... but I don't know how to get it all to work together. I'm a n00b when it comes to this so any help setting this up would be appreciated.

Rich
Reply With Quote
  #7 (permalink)  
Old 06-30-2005, 01:23 PM
brian.mark's Avatar
brian.mark brian.mark is offline
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default Re:

Quote:
Originally Posted by richkoi
mysqlfront works great... Except GoDaddy.com does not allow access from anything but their web access portal!

Right now I am using another host to create my tables and then exporting them to .sql files and then importing them using the GoDaddy webportal.

What would work much better for me is if I could use localhost to do this. I tried installing mySQL and PHP on my Windows XP pro machine... but I don't know how to get it all to work together. I'm a n00b when it comes to this so any help setting this up would be appreciated.

Rich
You may be able to use Putty to set up an SSH session, then use port forwarding to forward 3306 to the other end of the ssh session. That's how we do it here (we block 3306 with our firewall, then use SSH to open a port forward.) If you do a Google search for putty ssh port forward it usually comes back with some good results. Once that's set up, you just connect mysqlfront to localhost and you're good to go - it connects to the remote machine as if it is local.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #8 (permalink)  
Old 07-01-2005, 03:38 PM
RichardLynch RichardLynch is offline
WebProWorld New Member
 

Join Date: May 2005
Posts: 6
RichardLynch RepRank 0
Default CSV to MySQL

If you have SSH access in the first place, you don't really need to muck around with port forwarding and mysqlfront, really...

1. Upload the CSV to the server, just like you would any HTML/JPG/XYZ file.

2. SSH in to the host, and use:

mysql -u YOURUSERNAME -p YOURDATABASE

You'll be prompted for your password.

Then you can use MySQL's LOAD DATA INFILE command with the path to your CSV file.

http://mysql.com will have more details about how to work this command.

You could even write some kind of shell script or a PHP script to do this automatically whenver you upload a new file to some special directory or something.

There may well be a tool out there to do what the original question asked.

I'd try to Google for:
csv2sql
and then for
"convert CSV to SQL INSERT"

If those don't turn up something, it probably doesn't exist, because everybody else found it easier to just use mysql built-in tools than make a special tool just for that.
Reply With Quote
  #9 (permalink)  
Old 07-01-2005, 04:14 PM
brian.mark's Avatar
brian.mark brian.mark is offline
Administrator
 

Join Date: Jul 2004
Location: Omaha
Posts: 2,717
brian.mark RepRank 2brian.mark RepRank 2
Default Re: CSV to MySQL

Quote:
Originally Posted by RichardLynch
If you have SSH access in the first place, you don't really need to muck around with port forwarding and mysqlfront, really...

1. Upload the CSV to the server, just like you would any HTML/JPG/XYZ file.

2. SSH in to the host, and use:

mysql -u YOURUSERNAME -p YOURDATABASE

You'll be prompted for your password.

Then you can use MySQL's LOAD DATA INFILE command with the path to your CSV file.

http://mysql.com will have more details about how to work this command.

You could even write some kind of shell script or a PHP script to do this automatically whenver you upload a new file to some special directory or something.

There may well be a tool out there to do what the original question asked.

I'd try to Google for:
csv2sql
and then for
"convert CSV to SQL INSERT"

If those don't turn up something, it probably doesn't exist, because everybody else found it easier to just use mysql built-in tools than make a special tool just for that.
That may be an option, but a GUI is much simpler for beginners.

I've been doing mysql stuff for 6 years now and prefer a decent gui to the command line interface. Command line works, but a typo makes it not work and a GUI prevents those.

Brian.
__________________
ToolBarn.com, an Internet Retailer Top 500 and Inc. 500 Company | Tool Parts | Pet Supplies
Reply With Quote
  #10 (permalink)  
Old 07-02-2005, 09:49 AM
Rod Swift Rod Swift is offline
WebProWorld New Member
 

Join Date: Aug 2003
Location: UK
Posts: 9
Rod Swift RepRank 0
Default

I had a similar problem so I wrote a short PHP routine to open an uploaded CSV file, read each line, and load it into the database.

If you want some sample code then let me know.

Best Regards

Rod Swift
Reply With Quote
  #11 (permalink)  
Old 07-27-2005, 01:46 PM
ReviewGolf.com ReviewGolf.com is offline
WebProWorld Pro
 

Join Date: Mar 2004
Location: USA
Posts: 231
ReviewGolf.com RepRank 0
Default

What version of phpMyAdmin are you looking at? Most likely quite outdated. Install your own latest copy.
__________________
Site for sale: http://reviewgolf.com

"Web design is the area saturated by amateurs that confuse software capabilities with their own talent." ~~ me
Reply With Quote
  #12 (permalink)  
Old 02-08-2006, 05:27 PM
ceo4u ceo4u is offline
WebProWorld New Member
 

Join Date: Feb 2006
Posts: 1
ceo4u RepRank 0
Default csv2mysql

Visit the website below to convert from CSV to MySQL >>>

http://www.ceo4u.com/data

http://www.ceo4u.com/data

Peace,
Chris
Reply With Quote
  #13 (permalink)  
Old 06-27-2006, 05:40 PM
scottymore's Avatar
scottymore scottymore is offline
WebProWorld New Member
 

Join Date: Feb 2005
Location: Folsom, CA
Posts: 8
scottymore RepRank 0
Default Lot's of Goodies Here...

An inexpensive solution:

http://www.dbqwiksite.com/

There are a variety of products from this company which I have been very pleased with.
__________________
Best wishes,

Scott Perry

"When shooting ones self in the foot - be careful not to aim."(sp)
Reply With Quote
  #14 (permalink)  
Old 07-05-2006, 10:19 AM
kgun's Avatar
kgun kgun is offline
WebProWorld 1,000+ Club
 

Join Date: May 2005
Location: Norway
Posts: 4,696
kgun RepRank 3kgun RepRank 3
Default

Quote:
Originally Posted by richkoi
mysqlfront works great... Except GoDaddy.com does not allow access from anything but their web access portal!

Right now I am using another host to create my tables and then exporting them to .sql files and then importing them using the GoDaddy webportal.

What would work much better for me is if I could use localhost to do this. I tried installing mySQL and PHP on my Windows XP pro machine... but I don't know how to get it all to work together. I'm a n00b when it comes to this so any help setting this up would be appreciated.

Rich
You do that in 5 minutes using XAMPP. Read the first paragraphs of the front page of OopSchool in my signature.

What may be difficult is to find out where you have to store your projects. They should be stored in

c:\programfiles\xampp\htdocs\myproject

or wherever you installd xampp.

I use it with DreamWeaver and test PHP / MySQL pages by hitting F12.

Can it be easier?

I have installed Vista Beta, but not tried it on that plattform.
Reply With Quote
  #15 (permalink)  
Old 09-14-2006, 03:42 PM
Atlantean Atlantean is offline
WebProWorld Member
 

Join Date: Dec 2005
Location: Cleburne, TX
Posts: 33
Atlantean RepRank 0
Default

I'm having the same issue as the OP and I just don't understand it.

Just a couple of months ago I was doing the same operation with a CSV file from one of my merchants and inside the PHPMyAdmin CP I was able to select the file I wanted to import and I was ALSO able to choose option associated with importing a CSV file.

But now, there are no CSV options to select. What happened to them?
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Database Discussion Forum
Tags: csv, mysql



Thread Tools
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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



Search Engine Friendly URLs by vBSEO 3.0.0