On 11/28/08, Jim Winstead <[EMAIL PROTECTED]> wrote:
>
> having a way to load a file of data from the client in a fairly
> generic way is important. the non-LOCAL version of 'load data' has
> never been that useful to me in mysql because of the permissions (or
> just having the data on the wrong machine) issues.
This -- if you know the file is on the server, you should be able to log on
to the server and run LOAD DATA LOCAL INFILE from there. It's possible
someone's using LOAD DATA INFILE to periodically load data from a particular
file, but that seems like an ugly hack to me (ie, some way to share data
among disparate DBMS' or something).
but the implementation of 'load data local' is not great, particularly
> in the way that the protocol is used to tell the client to send a
> file.
>
> in general, i prefer the syntax of LOAD DATA to remembering a bunch of
> fiddly switches to something like mysqlimport, but that may just be
> me. that mysqlimport can't do any of the data manipulation during load
> that you can now do with LOAD DATA makes it even less useful.
mysqlimport should be taken out and shot, and then shot again, fwiw. Then
shot a few more times to make sure it's dead. LOAD DATA INFILE (with LOCAL
or without) is tons more useful. But having something in SQL format has,
for me, been the most useful, because the importing is self-contained -- I
can use that file to import, period.
With LOAD DATA ... INFILE I need a file plus a command for manipulation.
Plus, importing with the redirection operator on the OS command line (<), I
get exactly which line there's an error on, etc. Granted, there's no
transactional stuff there, which can be a problem, and IIRC LOAD
DATA...INFILE is an atomic statement (is it? even for myisam?).
Keep shooting mysqlimport though -- the filename corresponds to the table
name (MySQL strips the extension off).
But there's nothing more generic than a batch load using multiple
statements. It's easy enough to convert
foo,bar,baz
to
INSERT INTO tbl (fld1, fld2, fld3) VALUES ('foo','bar','baz');
But it's also easy to convert
foo,bar,baz
boo,far,faz
to
INSERT INTO tbl (fld1, fld2, fld3) VALUES ('foo','bar','baz'),
('boo','far','faz');
and take advantage of the batch inserts MySQL offers.
-Sheeri
jim
>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~drizzle-discuss
> Post to : [email protected]
> Unsubscribe : https://launchpad.net/~drizzle-discuss
> More help : https://help.launchpad.net/ListHelp
>
--
- Sheeri K. Cabral
Note: Currently I work for The Pythian Group (http://www.pythian.com/ ), a
remote DBA firm, and consulting would constitute a conflict of
interest. However, I do recommend our work, and if you're looking for DBA
work (I do MySQL work, but they have great Oracle and SQL Server DBAs too)
right now, whether you need a few hours a week, or someone fulltime while
you continue a job search.
I have a webpage with tips on how to find a DBA:
http://sheeri.net/how-to-find-a-dba/
I can recommend http://www.toomanyconnections.com as a good site to find
MySQL (and Oracle) DBAs.
If you're looking for web design, I recommend the small business my husband
works for, http://www.digital-loom.com
I regret that I have no other information for any other type of position,
including developer, programmer and systems administrator.
_______________________________________________
Mailing list: https://launchpad.net/~drizzle-discuss
Post to : [email protected]
Unsubscribe : https://launchpad.net/~drizzle-discuss
More help : https://help.launchpad.net/ListHelp