How do I import data from Excel Spreadsheet into Mysql?

Posted on 2008-10-13
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?

Question by:martyje
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

Accepted Solution

mredfelix earned 250 total points
ID: 22703003
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&"')'
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.
The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.


Author Comment

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?

Author Comment

ID: 22703289
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?

Author Closing Comment

ID: 31505581
Thanks much, I just had to give the 'exact' path of the file, it worked perfectly.

Author Comment

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)

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)

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

738 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