MySql backup and restore large database quickest way

Backing up MySql databases can be a horror, phpMyAdmin does not handle large databases well and it takes for ever..

Backing up

mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]

 

Restoring

mysql -u [uname] -p[pass] [db_to_restore] < [backupfile.sql]