This command should be invoked from the shell as the
command:

mysql --user mysqlusername -pmysqlpasswd database < test.sql

is actually running the mysql frontend with a username, password choosing
database named "database" and executing all commands from test.sql
before exiting.

If you want to invoke the same command from within mysql frontend
you write (after choosing \u "database")

mysql> \. test.sql

or you could actually just copy and past the items if you have
an ssh og telnet which support copying and pasting from your
favorite workstation to your favorite server :o)
(I do that sometimes, but it's a lazy thing to)

mvh:
Pål Wester, programmerer
never.no as, stortingsgt 30, 0161 Oslo
tlf: 22 01 66 20, fax: 22 01 66 21
direkte: 22 01 66 34, 906 900 62
http://never.no - icq:103476059
~ f u cn rd ts u prb a gk ~

> -----Opprinnelig melding-----
> Fra: C.o.m.b.u.s.t. [mailto:[EMAIL PROTECTED]]
> Sendt: 12. februar 2001 08:31
> Til: Nielsen; [EMAIL PROTECTED]
> Emne: Re: CREATE TABLE / Telnet (Linux / Unix server)
>
>
> Ok, I am trying to execute the CREATE TABLE command through
> telnet and the "test.sql" file is residing in the directory
> /home2/fullboreidiot/test.sql and I put in the command how I'm
> assuming it would be executed:
>
> mysql> mysql fullboreidiot < /home2/fullboreidiot/test.sql;
>
> and I get the following error:
>
> ERROR 1064: You have an error in your SQL syntax near 'mysql
> fullboreidiot < /home2/fullboreidiot/test.sql' at line 1
>
> Anyone know what I'm doing wrong?
>
>
> Derek Booth
> [EMAIL PROTECTED]
>   ----- Original Message -----
>   From: Nielsen
>   To: C.o.m.b.u.s.t. ; [EMAIL PROTECTED]
>   Sent: Sunday, February 11, 2001 9:24 PM
>   Subject: RE: CREATE TABLE / Telnet (Linux / Unix server)
>
>
>   > ...and this will load the table into your database.  Now, in the book
>   > it doesn't specify whether or not you have to be on the computer with
>   > the server, or if you can send the .sql file command from your
>   > computer to the remote server, sort of like a file transfer protocol
>   > as well.  Basically, my question is, do I have to either FTP my files
>   > to the server, and then execute the command, or can I do it remotely
>   > without FTP? Or is it possible AT ALL to execute the command from a
>   > remote computer?  In case it helps, I am on a Windows 98 system
>   > connected through SSH to an Linux system running Apache.  Please
>   > help, I'm stuck and I won't give up until I'm un-stuck!  Thanks in
>   > advance to all that reply.
>
>   The file must be on the remote machine (as has been answered),
> but yes, if you
>   are connected to the shell (via telnet/ssh/ssh2/etc), you can
> execute the
>   command.  And, no, the extension may be anything (all you're doing is
>   redirecting the contents of the file (via '<') into the 'mysql
> <database>'
>   command.
>
>   HTH,
>
>   Jon A. Nielsen.
>
>
>   ---------------------------------------------------------------------
>   Before posting, please check:
>      http://www.mysql.com/manual.php   (the manual)
>      http://lists.mysql.com/           (the list archive)
>
>   To request this thread, e-mail <[EMAIL PROTECTED]>
>   To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
>   Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>
>
>


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to