Closed Thread Icon

Preserved Topic: Excel and MySQL (Page 1 of 1) Pages that link to <a href="https://ozoneasylum.com/backlink?for=20873" title="Pages that link to Preserved Topic: Excel and MySQL (Page 1 of 1)" rel="nofollow" >Preserved Topic: Excel and MySQL <span class="small">(Page 1 of 1)</span>\

 
cybergrafx
Paranoid (IV) Inmate

From: Earth
Insane since: Sep 2000

posted posted 03-21-2001 18:57

Ok, I know I've seen something similar to this question before but I'm not sure where, anyway is it possible to convert an excel document into a mysql table on the fly?

thank you in advance . . .

bitdamaged
Maniac (V) Mad Scientist

From: 100101010011 <-- right about here
Insane since: Mar 2000

posted posted 03-21-2001 21:21

Save the file as a csv (comma seperated values), then upload or save the file to your server
The csv must be the same name as the table you are importing to and the table must be created and contain the same number of fields

then at your mysql prompt type

mysqlimport -h myhost.com -u yourusername -p yourpassword --fields-optionally-enclosed-by='"' --fields-terminated-by=',' --lines-terminated-by='n' mysqldatabasename /mydirectory/myfile.csv

Thats about right I can't test this right now.

BTW fields optionally closed by is:
single-quote double-quote single-quote

its a little hard to read

[This message has been edited by bitdamaged (edited 03-21-2001).]

cybergrafx
Paranoid (IV) Inmate

From: Earth
Insane since: Sep 2000

posted posted 03-21-2001 21:23

thanks bitdamaged, I'll give this a try.

« BackwardsOnwards »

Show Forum Drop Down Menu