Export a MySQL db to file:

mysqldump -h [SERVER] -u [USER NAME] -p [DATABAS]> dumpfil.sql

-> This command exports your database and saves it as "dumpfil.sql"

Import a MySQL db from file:

mysql -h [SERVER] -u [USER NAME] -p [DATABAS] <dumpfil.sql

-> This command imports your dump file into the database, it will overwrite existing tables of the same name!