MySQL – How to Take Backup from Another Server Using AutoMySQLBackup

MySQL

We have two servers namely serverA and serverB. I need to take mysql database backup of serverA staying at serverB. The tool I need to use is "AutoMySQLBackup".

I got the link for downloading it:

https://sourceforge.net/projects/automysqlbackup/

Extracted the tar and changed the config file in /etc/automysqlbackup/automysqlbackup.conf as per my need.

As I run automysqlbackup, I get the backups on daily basis though there are warnings:

###### WARNING ######
Errors reported during AutoMySQLBackup execution.. Backup failed
Error log below..
mysql: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqlshow: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: [Warning] Using a password on the command line interface can be insecure.
mysqldump: Got error: 1142: SELECT, LOCK TABLES command denied to user 'root'@'localhost' for table 'accounts' when using LOCK TABLES
mysqldump: [Warning] Using a password on the command line interface can be insecure.

But, I need to take the backup of remote server and don't find the way to do that using this tool. I tried using :

ssh serverA@ip-address | automysqlbackup 

but nothing is happening.

Note: I can't reply to answers so i am mentioning it here. I need to get the backup directly from serverA to serverB with the help of automysqlbackup like the way mysqldump or someother tool does.

mysqldump –host 192.168.1.15 -P 3306 -u dev -pmjQ9Y mydb > mydb.sql

Is there way to pipe automysqldump with ssh?
No scp,rsync.
I have access to certain database in serverA while accessing from serverB.

If anyone of you have used this tool, then please help me.

Best Answer

1: Are you able to do the backup? as i see an error on that message i got confused about it.

2: Did you set up a CRON to run the script daily? First thing that come to mind was to run a ssh copy of the backup to server B in the CRONjob (using SCP command)