Dumping a database into a file from terminal freezes I've had this a couple of times and I can't find a way around it. I'm dumping a mysql database from the terminal using the following command:

mysql -uusername -p my_database &gt; myfile.sql

When I run that and enter my password I wait and wait but nothing happens, the file myfile.sql is created but has the size of 0k. Am I missing something? Is there a better way to dump a database?
mysql is for interacting with the database.

mysqldump is what you want for this task.