mysql export syntax from within DB

I'm trying to export a query from a mysql command , but I keep getting the error

ERROR 1045 (28000): Access denied for user '_mamdoh'@'localhost' (using password: YES)

Do I need to back out of the database and run from the line below?

[_mamdoh@74 ~]$

This is what I'm using.

SELECT * INTO OUTFILE "C:\Documents and Settings\ckwill\My Document\newfile.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
FROM Clients;
ckwillGWUAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

hieloCommented:
Those backslashes need to be back-to-back backslashes:
SELECT * INTO OUTFILE "C:\\Documents and Settings\\ckwill\\My Document\\newfile.csv"
FIELDS TERMINATED BY ',' OPTIONALLY ENCLOSED BY '"'
LINES TERMINATED BY "\n"
FROM Clients;

Additionally, the error description indicates that the user account you are using (_mamdoh) does not have permission to exucute that command. Login as admin and then try executing the command again.

On the following url, there is an alerternative way to dump the data onto a file:
http://www.mysqlfaqs.net/mysql-faqs/Data-Back-Up/Export-Data/How-to-export-table-data-to-text-file-with-SELECT-INTO-OUTFILE-statement
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.