You could place the code that works in a text file and
feed the text file to mysql from the command line.

If the text file was named 'dothis', the command line
might look like:

'mysql -u username -p cDatabase < dothis'

You will be prompted for username's password after
pressing ENTER.  If you want this to happen at night,
execute the job via cron.

I hope this helps.

Andrew Gould

--- James Salinas <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> My problem is specifically concerning syntax for
> mysqldump.
> I can successfully execute the following SQL
> commands from within MYSQL:
> 
> mysql> USE cDatabase
> mysql> SELECT * INTO OUTFILE
> "/root/cTable-data.dump"
>   -> FIELDS TERMINATED BY ',' ENCLOSED BY '"'
>   -> FROM cTable WHERE myfield='1';
> 
> Query OK, 3693 rows affected (0.12 sec)
> 
> mysql>
> 
> This works fine and creates my dump file where it's
> supposed to.
> (of course, if the file already exists, it will give
> an error and not run)
> 
> my problem is I need a way to do the above from
> OUTSIDE of mysql
> so i have been trying for days to find out what the
> exact syntax is for using
> mysqldump and have not been successful.
> 
> mysqldump -T --fields-terminated-by=','
> --fields-enclosed-by='"' -u root -p cDatabase cTable
> > cTable-data.dump
> 
> The error I get is:  mysqldump: Can't create/write
> to file '--fields-terminated-by=,/main.sql'
> (Errcode: 2)
> 
> Basically, I have to get the data out of our mysql
> database and into Foxpro on a w32 machine.
> The fields must be enclosed in quotation marks " 
> and terminated by a comma ,  so they'll be imported
> correctly.
> 
> 
> Please help!!
> Jim
> 
> 


__________________________________________________
Do You Yahoo!?
Get email at your own domain with Yahoo! Mail. 
http://personal.mail.yahoo.com/

---------------------------------------------------------------------
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