Import:

/applications/MAMP/library/bin/mysql -u [USERNAME] -p [DATABASE_NAME] < [PATH_TO_SQL_FILE]

Export:

/applications/MAMP/library/bin/mysqldump -u [USERNAME] -p [DATA_BASENAME] > [PATH_TO_FILE]