On Sun, 21 Nov 2004 06:32:40 -0500, Patrick Questembert wrote:
Hi Patrick,
>WARNING: newbie here, trying to be on the contributing end for a change :-)
Glad to know I am not the only newbie here. :-)
>Firstly, I think all of your questions can be answered, without exception,
>by one look at the MySQL online manual.
Then you think incorrectly. Reading a manual and understanding it are
two totally different things.
>Remember the power of Google too,
Yes, I have. The power of Google IIRC gave me more than 9,000 "hits"
with my "1044 Access Denied" error.. Page after page of windows users
trying to work out why they got that error. The majority not getting
much more of an answer than RTFM. If a windows program had that many
people unable to even get to step number one then the programmer would
probably be laughed out of town. Or leave in disgrace of his own
volition.
Creating a database and creating/populating it is the most basic of
database tasks but MySQL makes one jump through hoops to do something
that is essentially trivial. In windows such things can be done with a
half dozen clicks of a mouse and maybe five minutes work.
>if
>you do a search on "load data infile MySQL" the first match you get is what
>you need: http://dev.mysql.com/doc/mysql/en/LOAD_DATA.html
Thanks for pointing out the exact part of the manual. It doesn't
however explain in any way how/where I am supposed to put that syntax.
Added to that it mentions such things as "The mysqlimport client"
without giving a download link and/or instructions as to where it is
installed to/run from.
>To your questions:
>The format of the source file can be CSV
Yes, I was pretty sure I had read that in one of the many pages I had
read. I couldn't however see how a C.S.V. file could supply data and
info such as "key" column data etc.
>- if that's the case, be sure to
>include the "FIELDS SEPARATED BY ','" directive for the load data statement.
Command syntax. You know, I was thinking that this mailing list was
for windows users. Yet almost every answer talks about Unix commands.
This is like joining a Toyota mailing list where every post is about
Fords.
>It is NOT .SQL - if it is .SQL, these would be statements you want to
>execute, which has nothing to do with loading data from a text file.
Well, thats what I first thought. Yet my hosting server had a video
tutorial where an .sql file appeared to be imported into a MySQL
database to create/populate it. From both a data and structure point
of view.
>Regarding location of the file, you have two choices with LOAD DATA:
>LOAD DATA LOCAL INFILE - will load data from a file located on the client,
>in which case the pathname of the file corresponds to the client
What's "the client" ? The hosting server ? A program ? If so then is
there a specific directory to load from ? The "mysql> LOAD DATA INFILE
'data.txt" suggests I need to find the mysql directory of the root on
my host's server.
>LOAD DATA - will load data from a file located on the server, in which case
>the pathname of the file corresponds to the server
C:\ ?
>Note that the server may be configured to disallow loading from files on the
>client.
Just what I needed. Another hoop to jump through. Thanks for pointing
that out.
>Lastly, you are NOT transferring "from the client's C: drive to the server's
>C: drive", you are loading from either the client
Well, the client would presumably be on my C: drive.
>or the server's drive onto
>a TABLE in the MySQL database, so only one drive is involved here.
Okay. Thanks.
Regards, John.