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