Solved

How do I import data from Excel Spreadsheet into Mysql?

Posted on 2008-10-13
7
374 Views
Last Modified: 2012-05-05
How do I import data from Excel Spreadsheet into Mysql?
I have a speardshee that I am trying to import into Mysql. How do I do that?

thanks.
0
Comment
Question by:martyje
  • 4
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
mredfelix earned 250 total points
Comment Utility
0
 
LVL 16

Expert Comment

by:Steve Krile
Comment Utility
I often do this by creating a new formula column in excel that creates INSERT statements for each line, then copying that formula down to each row.

A             B                C              D
Steve      Johnson     3323        ='INSERT INTO Employee(Firstname,Lastname,EmployeeNumber) VALUES('"&A2&"','"&B2&"','"&C2&"')'
0
 
LVL 16

Expert Comment

by:Steve Krile
Comment Utility
So, then I take the results of the formula in that column, and paste it into Query Analyzer or whatever, and execute it.
0
Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 

Author Comment

by:martyje
Comment Utility
I have no clue what u guys are talking about. Sorry. I am using phpMyadmin, should have stated that but anyway, is there any simple way to import excel file inot mysql through phpmyadmin?
0
 

Author Comment

by:martyje
Comment Utility
mredfelix:
I am getting an error "Can't find file 'test.csv' "
test.csv file is the file that I am trying to import. Myslq is residing on a different sever is that a problem?
0
 

Author Closing Comment

by:martyje
Comment Utility
Thanks much, I just had to give the 'exact' path of the file, it worked perfectly.
0
 

Author Comment

by:martyje
Comment Utility
Just an FYI, this is how the exact code that worked...

load data local infile 'c:\\wamp\\www\\test.csv' into table keywords
fields terminated by ','
enclosed by '"'
lines terminated by '\n'
(keyword, date_searched)
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

All XML, All the Time; More Fun MySQL Tidbits – Dynamically Generate XML via Stored Procedure in MySQL Extensible Markup Language (XML) and database systems, a marriage we are seeing more and more of.  So the topics of parsing and manipulating XM…
Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now