3 messages in com.mysql.lists.perlRE: load data infile script| From | Sent On | Attachments |
|---|---|---|
| BJ Phillips | 10 Apr 2002 11:43 | |
| Chuck O'Donnell | 10 Apr 2002 12:06 | |
| Neeraj Bezalwar | 16 Apr 2002 03:47 |
| Subject: | RE: load data infile script![]() |
|---|---|
| From: | Neeraj Bezalwar (neer...@neilsoft.com) |
| Date: | 04/16/2002 03:47:03 AM |
| List: | com.mysql.lists.perl |
Hi ,
I am creating a Web Based defect tracking system using JSP and MySQL. The system is as of now functional under MS Access, but I want to migrate to MySQL for the binary data support. I need to store quite a few images in the database, which wud make MS Access a very cumbersome option. Can anyone point me to a few docs / URL's where I can get sample code on saving binary files as a BLOB datatype in MySQL.
Cheerz Neeraj
-----Original Message----- From: Chuck O'Donnell [mailto:ca...@bus.net] Sent: Thursday, April 11, 2002 12:36 AM To: BJ Phillips Cc: Mysql-Modules; Bruce Newland Subject: Re: load data infile script
On Wed, Apr 10, 2002 at 11:43:52AM -0700, BJ Phillips wrote:
I was wondering if anybody could give me a quick and dirty script to load data into a table...but the catch is that the file name changes on a daily basis. It only needs to be done once a day, but I don't know anything about perl to make this script.
This is the raw load data infile: load data infile '/home/mysql/custom-pop-cfr_day_2002-03-25.csv' into table pop_daily fields terminated by ',' optionally enclosed by '"' ignore 1 lines;
i was going to suggest the mysqlimport utility, but i don't see an equivalent command line option to say "ignore 1 lines", and you would need to rename the file or copy it to match the table name.
maybe a shell script called from crontab that uses the mysql client, e.g.
#/bin/sh
echo "load data infile '/home/mysql/custom-pop-cfr_day_`date '+%Y-%d-%m'`.csv' \ into table pop_daily \ fields terminated by ',' \ optionally enclosed by '\"' \ ignore 1 lines" | mysql options database
good luck.
chuck
--------------------------------------------------------------------- Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before posting. To request this thread, e-mail msql...@lists.mysql.com
To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail msql...@lists.mysql.com instead.




