• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 389
  • Last Modified:

How do I import data from Excel Spreadsheet into Mysql?

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
martyje
Asked:
martyje
  • 4
  • 2
1 Solution
 
mredfelixCommented:
0
 
Steve KrileCommented:
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
 
Steve KrileCommented:
So, then I take the results of the formula in that column, and paste it into Query Analyzer or whatever, and execute it.
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
martyjeAuthor Commented:
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
 
martyjeAuthor Commented:
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
 
martyjeAuthor Commented:
Thanks much, I just had to give the 'exact' path of the file, it worked perfectly.
0
 
martyjeAuthor Commented:
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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now