MySQL Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsDatabasesMySQL Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
Stay one step ahead of the competition. Evaluate and give feedback on some of the hottest web development tools on the market today. Make your opinion heard! Click Here
  #1  
Old October 23rd, 2003, 05:28 PM
trystano trystano is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 45 trystano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Excel-to-MySQL

Does anyone know how I many transfer data from an Excel file across to a MySQL database?

Cheers
__________________
Tryst

Reply With Quote
  #2  
Old October 23rd, 2003, 06:23 PM
manoloweb manoloweb is offline
Moderated
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Monterrey MX
Posts: 49 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Well, there's three ways I use.

It depends on how large is the record size. And how often you will need to do this.

1st, by hand (one time, easy structure in your excel).-

In the rightmost cell in your excel, put a formula that result in a SQL insert statement... it should look something like this:

="INSERT INTO products (id,name,price) values (NULL,'"&A1&"',"&B1&");"

Which will result in a text like this:

INSERT INTO products (id,name,price) values (NULL,'mirror',157.25);

Then just copy that formula down, and then copy-paste all that into your MySQL manager (phpmyadmin, mysqlfront) and run it.

2nd, Saving as CSV and importing from MySQL

Just save your excel as a CSV (comma separated values) file and then use your MySQL manager to impot the file (or run mysqlimport from the shell) to your table.

3rd, ODBC

Make your XLS file available as an ODBC source, and then use MySQL Front or any other tool to import the data.

This could be better if you plan to do this in a regular basis or if the ammount of data is too big.

------------------- ------------------ ------------
I know there must be better ways to achieve this, but I wanted to share how do I handle this. And I do it very often because most of my customers have their information in excel files (I deal with small companies almost all the time)

__________________
The deal is not to know everything, but to know the email of the one who does.

Reply With Quote
  #3  
Old October 24th, 2003, 07:03 AM
nicat23's Avatar
nicat23 nicat23 is offline
Addicted to Chaos..
Dev Articles Novice (500 - 999 posts)
 
Join Date: Jan 2003
Location: Ft. Worth, TX
Posts: 653 nicat23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 47 m 52 sec
Reputation Power: 0
Send a message via AIM to nicat23 Send a message via Yahoo to nicat23
You could also write a little vba program to do this for you...

Reply With Quote
  #4  
Old October 27th, 2003, 06:31 AM
trystano trystano is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 45 trystano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
mysqlimport

Uhm, excuse me lack on knowledge in MySQL here, but i've never used, mysqlimport before. Is it just a simple command, that uses the CSV file as a parameter?

Reply With Quote
  #5  
Old October 27th, 2003, 10:29 AM
manoloweb manoloweb is offline
Moderated
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Location: Monterrey MX
Posts: 49 manoloweb User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
Check this out:


http://www.mysql.com/doc/en/mysqlimport.html

or this, if you want to do it from a script:

http://www.mysql.com/doc/en/LOAD_DATA.html


Reply With Quote
  #6  
Old October 30th, 2003, 01:43 PM
trystano trystano is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2003
Posts: 45 trystano User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
CSV - MySQL

If I was to save the Excel file as a CSV (comma separated value) file, and imported that file into MySQL, would I need to create the database in MySQL first?

If I was to have 5 columns in Excel, then CSV'd that file, would MySQL put the data into the right coulmns in the MySQL table??

cheers

Reply With Quote
  #7  
Old July 12th, 2005, 06:33 AM
klyau23 klyau23 is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jul 2005
Posts: 3 klyau23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 19 m 51 sec
Reputation Power: 0
Converting Excel to Mysql

Hi All,

Wondering on how to convert excel spreadsheet to MYSQL database easily without incurring any cost? Visit this web site

http://excel2mysql.f2g.net

By following simple and intuitive steps, you will be able to get a mysql database. But, get a free copy of phpMyadmin from the internet first. It's simple to get it, just type phpmyadmin at the google search engine or visit http://www.phpmyadmin.net/home_page/.

Thanks.

Reply With Quote
  #8  
Old October 11th, 2005, 10:20 AM
paolom paolom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 2 paolom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 14 sec
Reputation Power: 0
Quote:
Originally Posted by manoloweb
Well, there's three ways I use.

It depends on how large is the record size. And how often you will need to do this.

1st, by hand (one time, easy structure in your excel).-

In the rightmost cell in your excel, put a formula that result in a SQL insert statement... it should look something like this:

="INSERT INTO products (id,name,price) values (NULL,'"&A1&"',"&B1&");"

Which will result in a text like this:

INSERT INTO products (id,name,price) values (NULL,'mirror',157.25);

Then just copy that formula down, and then copy-paste all that into your MySQL manager (phpmyadmin, mysqlfront) and run it.

2nd, Saving as CSV and importing from MySQL

Just save your excel as a CSV (comma separated values) file and then use your MySQL manager to impot the file (or run mysqlimport from the shell) to your table.

3rd, ODBC

Make your XLS file available as an ODBC source, and then use MySQL Front or any other tool to import the data.

This could be better if you plan to do this in a regular basis or if the ammount of data is too big.

------------------- ------------------ ------------
I know there must be better ways to achieve this, but I wanted to share how do I handle this. And I do it very often because most of my customers have their information in excel files (I deal with small companies almost all the time)


how may i do:
"Make your XLS file available as an ODBC source, and then use MySQL Front or any other tool to import the data." ???

Reply With Quote
  #9  
Old October 11th, 2005, 12:03 PM
paolom paolom is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2005
Posts: 2 paolom User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 m 14 sec
Reputation Power: 0
how may i do:
"Make your XLS file available as an ODBC source, and then use MySQL Front or any other tool to import the data." ???

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsDatabasesMySQL Development > Excel-to-MySQL


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway