Solved

How do I import data from Excel Spreadsheet into Mysql?

Posted on 2008-10-13
7
382 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
7 Comments
 
LVL 5

Accepted Solution

by:
mredfelix earned 250 total points
ID: 22703003
0
 
LVL 16

Expert Comment

by:Steve Krile
ID: 22703088
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
ID: 22703097
So, then I take the results of the formula in that column, and paste it into Query Analyzer or whatever, and execute it.
0
U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

 

Author Comment

by:martyje
ID: 22703236
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
ID: 22703289
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
ID: 31505581
Thanks much, I just had to give the 'exact' path of the file, it worked perfectly.
0
 

Author Comment

by:martyje
ID: 22704637
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

What Is Transaction Monitoring and who needs it?

Synthetic Transaction Monitoring that you need for the day to day, which ensures your business website keeps running optimally, and that there is no downtime to impact your customer experience.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

As a database administrator, you may need to audit your table(s) to determine whether the data types are optimal for your real-world data needs.  This Article is intended to be a resource for such a task. Preface The other day, I was involved …
Foreword This article was written many years ago, in the days when PHP supported the MySQL extension (http://php.net/manual/en/function.mysql-connect.php).  Today (http://php.net/manual/en/migration70.removed-exts-sapis.php) you would not use MySQL…
If you're a developer or IT admin, you’re probably tasked with managing multiple websites, servers, applications, and levels of security on a daily basis. While this can be extremely time consuming, it can also be frustrating when systems aren't wor…
In this video, viewers are given an introduction to using the Windows 10 Snipping Tool, how to quickly locate it when it's needed and also how make it always available with a single click of a mouse button, by pinning it to the Desktop Task Bar. Int…

726 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