List:General Discussion« Previous MessageNext Message »
From:Gerald Clark Date:April 4 2001 6:50pm
Subject:Re: Please help with MYSQLDUMP syntax errors
View as plain text  
Peter Skipworth wrote:
> 
> mysql --username=xxx --password=xxx -e "SELECT * INTO OUTFILE
> "/root/cTable-data.dump" FIELDS TERMINATED BY ',' ENCLOSED BY '"' FROM cTable WHERE
> myfield='1'" dbname
> 
>  On Wed, 4 Apr 2001, James
> Salinas 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
> >
> >
> 
>

You have improperly nested quotes.
Thread
Please help with MYSQLDUMP syntax errorsJames Salinas4 Apr
  • Re: Please help with MYSQLDUMP syntax errorsPeter Skipworth4 Apr
    • Re: Please help with MYSQLDUMP syntax errorsGerald Clark4 Apr
  • Re: Please help with MYSQLDUMP syntax errorsAndrew Gould4 Apr