# mysqldump -host parameter
When running mysqldump without mentioning the -host
parameter, localhost
is used by default.
In case you want to dump a database that runs on another machine with a different host, you have to include the -host
flag (or its short form -h
) in the command.
# Using the -host flag
mysqldump my_database -host 192.123.33 > my_backup.sql
# Using the -h flag
mysqldump my_database -h 192.123.33 > my_backup.sql
After running the command from the example above, mysqldump will try to connect using the host 192.123.33 instead of the default one.
In case you want to know how to change the mysqldump host to backup a remote database, here we have a full article about that.