Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



Reply
Import .xls data into Mysql DB
Old 02-04-2009, 04:28 PM Import .xls data into Mysql DB
motivatingfator's Avatar
Experienced Talker

Latest Blog Post:
We Could Lose Our Freedom
Posts: 38
Name: Richard Morrison
Location: Lima, Ohio, USA
Trades: 0
Hello,

I would like to import data from an .xls file into a Mysql DB so I can query the information from a webpage. Please provide me with step by step instructions. I have already created a DB and table with the field names exactly the same as the .xls column titles (with the exception of the DB having an extra field - ID - to be used as the primary key).

Any assistance with this is greatly appriciated.

Very Best Regards,
Richard
__________________
Richard Morrison - Blogger / Consultant
E-Mail:
Please login or register to view this content. Registration is FREE
Web Address:
Please login or register to view this content. Registration is FREE
motivatingfator is offline
Reply With Quote
View Public Profile Visit motivatingfator's homepage!
 
 
Register now for full access!
Old 02-06-2009, 09:28 AM Re: Import .xls data into Mysql DB
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Save as a CSV file then import it with;

LOAD DATA INFILE 'csv_file' REPLACE INTO TABLE table_name FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '\"' LINES TERMINATED BY '\r\n' IGNORE 1 LINES ;

http://dev.mysql.com/doc/refman/5.1/en/load-data.html

MAKE SURE the fields are in the same order in the DB as they are in the .xls
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 02-06-2009, 12:01 PM Re: Import .xls data into Mysql DB
motivatingfator's Avatar
Experienced Talker

Latest Blog Post:
We Could Lose Our Freedom
Posts: 38
Name: Richard Morrison
Location: Lima, Ohio, USA
Trades: 0
Thanks for your help.
__________________
Richard Morrison - Blogger / Consultant
E-Mail:
Please login or register to view this content. Registration is FREE
Web Address:
Please login or register to view this content. Registration is FREE
motivatingfator is offline
Reply With Quote
View Public Profile Visit motivatingfator's homepage!
 
Old 11-30-2010, 12:35 PM Re: Import .xls data into Mysql DB
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
How do I import it's data into mysql!??
You can't xls is a proprietary format and MySql cannot read it.

AS ABOVE you will have to EXPORT the data first.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-30-2010, 02:56 PM Re: Import .xls data into Mysql DB
Super Spam Talker

Posts: 800
Name: Paul W
Trades: 0
There are software packages available to do this but I've never tried any (and you'd have to pay for it). The reason you wouldn't knock up a quick script is the amount of proprietary crap Microsoft adds: just compare the size of any MS file with the amount of actual data -- megabytes of what many suspect is obfuscatory rubbish.
PaulW is offline
Reply With Quote
View Public Profile
 
Old 11-30-2010, 03:42 PM Re: Import .xls data into Mysql DB
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,519
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Quote:
megabytes of what many suspect is obfuscatory rubbish.
Actually the "growth" of most M$ file formats is because they keep an audit trail/undo history that the "auto recovery" can use when sorry, if the application crashes.

A File -> Save As... will clear the garbage and reduce the file size.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 11-30-2010, 04:28 PM Re: Import .xls data into Mysql DB
Junior Talker

Posts: 2
Trades: 0
Try the SQL Data Examiner: the tool can import data from xls to MySQL. The free trial is available, so you don't need to purchase the tool to do the import
sqldev is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Import .xls data into Mysql DB
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.46519 seconds with 12 queries