I have seen this two ways:
mysqldump -u username -ppassword --databases mydb >with.sql
mysqldump -u username -ppassword mydb >without.sql
I did a linux 'diff' on the two and the with.sql file has this:
< CREATE DATABASE /*!32312 IF NOT EXISTS*/ `mydb` /*!40100 DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci */;
<
< USE `mydb`;
While the without.sql doesn't. I have used --databases on mysqldump but I have seen tutorials showing it without when doing a mysqldump on a single database.
Why are they different? Which one is most common to use? I'm preparing a mysqldump of a database for a client which might run it in Linux or Windows, so is there a concern of being more portable?