Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a MySQL db on Machine A and I want to access the mysqldump from machine B.

Both machines are running on Linux and I also have the credentials of both, but I can't access the mysqldump. What can I try?

share|improve this question
up vote 9 down vote accepted

In General if you have the credentials for accessing MySql from Machine B.

You should have MySQL user name , host name and Password.Then You can write the Command for taking backup

On Machine B Write

mysqldump -h Your_host_name -u user_name -p password --all-databases > backup.sql

If You Face issues there may be some network issue try some things as

  1. Use ping with ip address to check that DNS isn't broken. eg. ping Machine A
  2. Use mysql client to connect from B to A. eg mysql -u user -pPASS --host=Host_Name --port=3306 (substitute whatever port you are connecting to the master on)
share|improve this answer
If you still face the issue please update properly with your question. – Abdul Manaf Feb 22 '12 at 10:47
Thanks, the below script works for me,mysqldump -h -p -u resolution -P 3307 communitycourts > backup.sql. As I haven't mentioned port number earlier, So it was not working for me. – Selvakumar P Feb 22 '12 at 11:53
@AbdulManaf - Can this be done if I need to SSH to the server? And what about the situation when I want to initiate a mysqldump and restore from my local machine -> from server A to server B. I have SSH for both the servers. Adding -i /path/to/private/key is not working for me somehow. – MontyPython Oct 29 '15 at 9:44

if you use --host MachineA as parameters of mysqldump should work

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.