List:MySQL on Win32« Previous MessageNext Message »
From:Patrick Questembert Date:November 21 2004 11:32am
Subject:RE: Steps to importing table data.
View as plain text  
WARNING: newbie here, trying to be on the contributing end for a change :-)

Firstly, I think all of your questions can be answered, without exception,
by one look at the MySQL online manual. Remember the power of Google too, 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

To your questions:

The format of the source file can be CSV - if that's the case, be sure to
include the "FIELDS SEPARATED BY ','" directive for the load data statement.
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.

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
LOAD DATA - will load data from a file located on the server, in which case
the pathname of the file corresponds to the server

Note that the server may be configured to disallow loading from files on the
client.

Lastly, you are NOT transferring "from the client's C: drive to the server's
C: drive", you are loading from either the client or the server's drive onto
a TABLE in the MySQL database, so only one drive is involved here.

Hope this helps.

Patrick

-----Original Message-----
From: John Fitzsimons [mailto:johnf@stripped]
Sent: Sunday, November 21, 2004 12:42 AM
To: win32@stripped
Subject: Re: Steps to importing table data.


On Sun, 21 Nov 2004 02:26:44 -0200, Daniel da Veiga wrote:

>PhpMyAdmin is good, of course, but you see, it really hides a lot of
>details that you'll step on while you're a developer, it would be good
>if you learn the commands (console, SQL) instead of using this kind of
>wizard.

Well, I don't mind learning some commands but it seems like there are
many dozens/hundreds of commands, and variations of commands. A
major undertaking to learn/apply correctly.

If I were 30 years younger your idea might have more appeal, but I am
not. Added to that I ceased doing much command line stuff over ten
years ago.

>Even if your machine isn't the server, you can install the
>client

No idea what "client" you are talking about. Or how to setup/use
it.  :-( My system is a win '98 one. My hosting co has, IIRC,
Unix/Apache/MySQL.

>and connect to the database via console.

I am guessing you are meaning some sort of telnet connection from my
windows box ? In any case I haven't used telnet for many years either
and wouldn't know which directories to connect to or execute commands
in.

>The command "grant all
>privileges on *.* to 'jf'" might work...

Ah ! That looks good. If I can work out where/how to apply that
command I will try it.

>To import data, the command
>"load data infile" is a good way.

The "infile" is my .sql or c.s.v. file ? If so I am not sure what the
relative syntax for transfer from my C:\ drive to the server's C:\
drive is. I guess I would get the IP address' of both  and use
them somehow ?

Somewhat more complex than copy C:\something to D:\ It is
a pity everything Unix is so tedious/complex.  :-(

>Best regards,

< snip >

Thanks Daniel. It sure is nice to see some competent people here
willing to help those of us who are newbies in regard to SQL/Unix.

Regards, John.


--
MySQL Windows Mailing List
For list archives: http://lists.mysql.com/win32
To unsubscribe:    http://lists.mysql.com/win32?unsub=1

Thread
Steps to importing table data.John Fitzsimons21 Nov
  • Re: Steps to importing table data.Daniel da Veiga21 Nov
    • Re: Steps to importing table data.John Fitzsimons21 Nov
      • RE: Steps to importing table data.Patrick Questembert21 Nov
        • Re: Steps to importing table data.John Fitzsimons21 Nov
          • Re: Steps to importing table data.Daniel da Veiga22 Nov
            • Re: Steps to importing table data.John Fitzsimons5 Dec
              • Re: Steps to importing table data.John Fitzsimons5 Dec
      • Re: Steps to importing table data.Graeme St.Clair6 Dec
Re: Steps to importing table data.Fred Friedman8 Dec
  • Help with using Text and Blob typesDanny Willis8 Dec
RE: Help with using Text and Blob typesDanny Willis8 Dec
  • RE: Help with using Text and Blob typesRandy Clamons8 Dec
    • RE: Help with using Text and Blob typesDanny Willis15 Dec
      • RE: Help with using Text and Blob typesRandy Clamons15 Dec
        • RE: Help with using Text and Blob typesDanny Willis15 Dec