1#note by specifying -p flag without a password it'll prompt you for pass
2
3DUMP:
4mysqldump -u username -p dbname --lock-tables=false > filename.sql
5
6Import:
7mysql -u username -p dbname < filename.sql
8
9Import external:
10mysql -h host -u username -p dbname < filename.sql
1# Syntax
2mysqldump -u [username] -p [database-to-dump] > [database-to-receive]
3
4# Pipe it! Exporting DB from external host
5mysqldump -u [username] -P [port] -h [host] [database-to-dump] | mysql -u root -h 127.0.0.1 [database-to-receive]
6
7# Export specific tables by typing the name after the targeted DB
8mysqldump -u [username] -P [port] -h [host] [database-to-dump] [tabl1] [table2] [table3] | mysql -u root -h 127.0.0.1 [database-to-receive]