MySQL Commands, Administration, Backup, Restore
SOURCE : STACKOVERFLOW
To export If it’s an entire DB, then:
mysqldump -u [uname] -p[pass] db_name > db_backup.sql
mysqldump -u [uname] -p[pass] --all-databases > all_db_backup.sql
mysqldump -u [uname] -p[pass] db_name table1 table2 > table_backup.sql
mysqldump -u [uname] -p[pass] db_name | gzip > db_backup.sql.gz
mysqldump -P 3306 -h [ip_address] -u [uname] -p[pass] db_name > db_backup.sql
mysql -u username -p -h localhost DATA-BASE-NAME < data.sql
mysql -u sat -p -h localhost blog < data.sql
mysql -u username -p -h 202.54.1.10 databasename < data.sql
mysql -u username -p -h gautamthakur.net database-name < data.sql
mysql -u username -p -h 202.54.1.10 < data.sql