To create a back up file under unix or lunix use:
mysqldump -u USER -pPASSWORD DATABASE_NAME > DATABASE_NAME.sql
where USER: the database user name,
PASSWORD: the password for that user,
DATABASE_NAME: the Database name.
If you have the sql file and want to restore your database from, you can use the following:
mysql -u USER -pPASSWORD DATABASE_NAME < DATABASE_NAME.sql