0

I am getting the following error when I try to dump a specific table of mysql database.

Steps:

  • SSH'ed to a machine
  • Moved into the mysql session
  • Executed the following command

mysql> mysqldump -urefill -p refill Refill > Users/zainbutt/Documents/Refill.sql; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'mysqldump -urefill -p refill Refill > Refill2.sql' at line 1

1
  • 3
    mysqldump is a separate program. You're trying to run it from within the mysql monitor as if it was a query. Commented Sep 8, 2014 at 17:26

2 Answers 2

2

mysqldump is a program in its own right, not a query to be called from within mysql. You call it from a shell, not from a mysql prompt.

Sign up to request clarification or add additional context in comments.

8 Comments

could you please list down the steps?
what steps? it's a SEPARATE PROGRAM.
then how should I be able to take a dump?
You do exactly what you have done, but skip the bit where you move into a mysql session.
then it gives me the following error $ mysqldump -urefill -p refill Refill > Users/zainbutt/Documents/Refill.sql; -bash: Users/zainbutt/Documents/Refill.sql: No such file or directory
|
0

Please try this

mysql> mysqldump -u refill -prefill Refill > Users/zainbutt/Documents/Refill.sql

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.