Search code examples
mysqldatabasebackupremote-serverdatabase-restore

How to backup MySQL database on a remote server?


I have a MySQL database existing on a remote server. I only have connection privilege. I don't have FTP access to the server, and I need to do a complete dump of the database. I have tried mysqldump, but the issue is that it is creating the output on the server and as I don't have FTP I can not get the output from the server.

How can I do a clean backup and get the dump in my local machine(of course, the backup should be restored in my local machine)?


Solution

  • You can specify the server name as an option to mysqldump:

    mysqldump --host servername dbname > dbname.sql