mysqldump -u foo -p foodb > foodb.sql
where:
mysqldump -u foo -p --all-databases > alldb.sql
where:
1. From terminal
mysql -u foo -p foodb < foodb.sql
where:
2. From inside mysql console where you have to access mysql console first:
mysql> source foodb.sql or mysql> \. foodb.sql
where foodb.sql is the dumpfile.