Mysql Backup and Restore (Dump and Import)
MySQLmysqldump -u username -p database_name > data-dump.sql
Dump from remote machine
MySQLmysqldump -h host -u username -p database_name > data-dump.sql
Dump using different port (3306 is default)
MySQLmysqldump -h host -u username --port=12345 -p database_name > data-dump.sql
First create database and then import *.sql dump
MySQLmysql -u username -p new_database < data-dump.sql
Import to remote machine
MySQLmysql -h host -u username -p new_database < data-dump.sql
-u user | (db user)
-p password | (ask for password)
-h host | (FQDN or IP)
--port=12345 or -P 12345 | change port