how to fill in a mySql database from an excel file?
Moderator: General Moderators
-
tonguim
- Forum Newbie
- Posts: 21
- Joined: Mon Jun 30, 2003 12:53 pm
- Location: Ouagadougou, BURKINA FASO
- Contact:
how to fill in a mySql database from an excel file?
Hy
I have an excel file which have 728 records; i would like to fill in my mySql database with this excel file. It seems that it's possible, but i don't have no more informations on how to do it. Can you help me? Thanks.
[url = http://tonguim.free.fr][/url]
I have an excel file which have 728 records; i would like to fill in my mySql database with this excel file. It seems that it's possible, but i don't have no more informations on how to do it. Can you help me? Thanks.
[url = http://tonguim.free.fr][/url]
-
JPlush76
- Forum Regular
- Posts: 819
- Joined: Thu Aug 01, 2002 5:42 pm
- Location: Los Angeles, CA
- Contact:
mmmmmm mysql load function yummmmmy
I actually do this 4-8 times a week at my work. Basically you just have to save your excel file as a tab separated text file and then upload that text file to your webserver and do the following
LOAD DATA INFILE '/usr/local/apache/htdocs/yourdirectory/nameoffile.txt' INTO TABLE mytable FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
I actually do this 4-8 times a week at my work. Basically you just have to save your excel file as a tab separated text file and then upload that text file to your webserver and do the following
LOAD DATA INFILE '/usr/local/apache/htdocs/yourdirectory/nameoffile.txt' INTO TABLE mytable FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
Yucky may be, that's a matter of opinion..
what is unstable?
AFAIK the myODBC Stable driver is pretty good? And I doubt that Excel dont know how to handle it...
If you refer to PHP's ODBC functionality, that may be, I've had bad experiences with (unsupported) UnixODBC and generic openlink drivers on GNU/Linux, but in this thread I was refering to an Excel-ODBC-MySQL connection without using PHP....
what is unstable?
AFAIK the myODBC Stable driver is pretty good? And I doubt that Excel dont know how to handle it...
If you refer to PHP's ODBC functionality, that may be, I've had bad experiences with (unsupported) UnixODBC and generic openlink drivers on GNU/Linux, but in this thread I was refering to an Excel-ODBC-MySQL connection without using PHP....
-
tonguim
- Forum Newbie
- Posts: 21
- Joined: Mon Jun 30, 2003 12:53 pm
- Location: Ouagadougou, BURKINA FASO
- Contact:
Thank you JPlush76 and Stoker for your instant answer.
I'll try what you suggest me.
JPlush suggest me to do this:
LOAD DATA INFILE '/usr/local/apache/htdocs/yourdirectory/nameoffile.txt' INTO TABLE mytable FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
Should i write these lines in a program, or where should i insert these lines? Thanks
I'll try what you suggest me.
JPlush suggest me to do this:
LOAD DATA INFILE '/usr/local/apache/htdocs/yourdirectory/nameoffile.txt' INTO TABLE mytable FIELDS TERMINATED BY '\t' LINES TERMINATED BY '\n';
Should i write these lines in a program, or where should i insert these lines? Thanks
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK