If you are using MAMP then you can follow the steps from terminal.
Go to the directory where MySQL is installed. MySQL is installed in “/Applications/MAMP/Library/bin/” directory. Now enter the following command:
cd /Applications/MAMP/Library/bin/
Now you execute the following command:
./mysql -u database_username -p database_name < /backup_file.sql
Change the file path where you have kept your database file, change this part of the command.Now when it ask for the password of database user just enter the pass. Thats all you need.