How to backup MySQL database on a remote server? How to backup MySQL database on a remote server? database database

How to backup MySQL database on a remote server?


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

mysqldump --host servername dbname > dbname.sql


mysqldump --host hostaddress -P portnumber -u username -ppassword dbname > dbname.sql

Normally the remote port of MySQL is 3306. Here is an example:

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


You can use the MySQL workbench http://www.mysql.com/products/workbench/, which can backup directly to a local folder through a user-friendly interface