Unix Technical Forum

Import from an excel file

This is a discussion on Import from an excel file within the MySQL forums, part of the Database Server Software category; --> Hi .... How can I import some columns of an excel file in some fields in a remote MySQL ...


Go Back   Unix Technical Forum > Database Server Software > MySQL

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 07-06-2008, 09:58 AM
Sarah
 
Posts: n/a
Default Import from an excel file

Hi .... How can I import some columns of an excel file in some fields in
a remote MySQL table??

I've tried with PhpMyAdmin but when I select a CSV file I obtain:


query SQL:

id;

Messaggio di MySQL: Documentazione
#1064 - You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'id' at line 1


Can you tell me solution for import my fields.... with an easy and
simple solution?

Thanks
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 07-06-2008, 09:58 AM
Paul Lautman
 
Posts: n/a
Default Re: Import from an excel file

Sarah wrote:
> Hi .... How can I import some columns of an excel file in some fields
> in a remote MySQL table??
>
> I've tried with PhpMyAdmin but when I select a CSV file I obtain:
>
>
> query SQL:
>
> id;
>
> Messaggio di MySQL: Documentazione
> #1064 - You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'id' at line 1
>
>
> Can you tell me solution for import my fields.... with an easy and
> simple solution?
>
> Thanks


I generally use Excel formulas to create the relavant INSERT statements and
them run those


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 07-06-2008, 09:58 AM
toby
 
Posts: n/a
Default Re: Import from an excel file

On Jul 5, 1:42*pm, Sarah <nom...@nomail.it> wrote:
> Hi .... How can I import some columns of an excel file in some fields in
> a remote MySQL table??
>
> I've tried with PhpMyAdmin but when I select a CSV file I obtain:
>
> query SQL:
>
> id;
>
> Messaggio di MySQL: Documentazione
> #1064 - You have an error in your SQL syntax; check the manual that
> corresponds to your MySQL server version for the right syntax to use
> near 'id' at line 1
>
> Can you tell me solution for import my fields.... with an easy and
> simple solution?


It's trivial to import CSV or tab-delimited data into MySQL, for
example:

LOAD DATA INFILE 'file.csv'
INTO TABLE tbl
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
(list,your,columns,here)

The file must be accessible to the MySQL server (i.e. it should be
copied to the server).

Use the CLI client, avoid PHPMyAdmin and you should be fine.

>
> Thanks


Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 05:43 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com