Backup from a remote server

Sometimes, you may not have SSH access to the database server (as in the case of cloud instances such as Amazon RDS). In those cases, you can use mysqldump to take a backup from a remote server to the local server. For this, you need to mention hostname using the --hostname option. Make sure that the user has appropriate privileges to connect and perform a backup:

shell> mysqldump --all-databases --routines --events --triggers --hostname <remote_hostname> > dump.sql

Get MySQL 8 Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.