Now that you have mysqldump working, and have verified it outputs correctly to the screen, you can send the backup data directly to a file using the > redirect symbol.
mysqldump only works under terminal, not under mysql client.
Dumping the etunimitietokantadb database to a file:
mysqldump -u user –p password etunimitietokantadb > etunimitietokantadb.sql
The command in stores the backup file into the current directory. If you need it to be saved elsewhere, you should insert a file path before the filename. You must also ensure that the directory you are backing up to has the right permissions set to allow the file to be written.