How to import mysql database using ssh command?

mysql -uUSERNAME -p DATABASE < backup.sql

or full version

mysql -P 3311 -h 127.0.0.1 -u userfordb -p databasename < backupfile.sql