14

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?

17

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)
  • @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
2

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

2

This is for taking a dump of a specific table

mysqldump -h 'hostname' -vv -u'user' -p'password' database_name table_name | gzip > table_name.sql.gz
-1

I put it like this and it works perfectly

mysqldump -P 7999 -h '192.168.1.25' -vv -u'user' -p'password' base_dados | gzip > base_dados.sql.gz

  • It would improve this immensely if you added in some explanation of how it addresses the original question. – Michael Green Nov 15 at 0:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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