Backuping mysql

MySQL
- database involed

backup
mysqldump --opt -u [uname] -p[pass] [dbname] > [backupfile.sql]
or better solutions when data lock error
mysqldump --single-transaction

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

alternatively:
mysqldump -u username -p -v olddatabase > olddbdump.sql
mysqladmin -u username -p create newdatabase
mysql -u username -p newdatabase < olddbdump.sql