How to Backup Remote MySQL Database Using mysqldump

MySQL

I tried to backup the database of a remote server using automysqlbackup.

From this platform, I learnt it was not possible without ssh and I need to back it up on a remote machine and then rsync or scp to my local machine, so I am now working with mysqldump.

The size of the database is almost 12GB.

mysqldump -h 192.168.10.209 -u user -ppassword testdb   > dump.sql

I tried backing it up and due to internet issues I have been disconnected twice already., and got this error once:

mysqldump: Couldn't execute 'SELECT /*!40001 SQL_NO_CACHE */ * FROM `helmet`': Lost connection to MySQL server during query (2013)

Is there way to continue from where it got disconnected using msyqldump?

I also read that mysqldump is not good for such a big database backup but I need to test it from here only at this moment.

Are there any options that can be used to make it work smoothly and backup my database?

Best Answer

Unfortunately, you cant continue your failed backup. When mysqldump returns a failed status you have to start over again.

My first recommendation is to compress your script before transmitting it

mysqldump -h 192.168.10.209 -u user -ppassword testdb | gzip > dump.sql.gz

Another recommendation is to connect to the remote server via ssh, then make the backup in the remote server (never will fail for network issues because is a local backup) and, in the last step you could transmit the file (after compress of course).

Other than that, the other 2 options more used are PERCONA XTRA BACKUP and MYSQL ENTERPRISE BACKUP but there are also high prices involved.