Mysqldump complains about chosen databases regardless of command line

MySQL

Mysqldump complains about command line options I have never specified. I don't have shell aliases nor a custom .my.cnf file set. What am I doing wrong?

Using the --database long option:

$ mysqldump --user cloud -p --database cloud > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and  will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.

Using the --databases long option:

$ mysqldump --user cloud -p --databases cloud > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'

Using the --all-databases long option:

$ mysqldump --user cloud -p --all-databases > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'

Using just the db name:

$ mysqldump --user cloud -p cloud > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'

And finally, specifying nothing whatsoever:

$ mysqldump --user cloud -p > backup.mysqldb
Warning: Using unique option prefix database instead of databases is deprecated and will be removed in a future release. Please use the full name instead.
Warning: mysqldump: ignoring option '--databases' due to invalid value 'cloud'

Best Answer

In your .my.cnf options file, you probably have the database parameter specified for all clients, but mysqldump doesn't like that parameter. So don't list that parameter for all clients in your options file.

For example, here's how I solved it so the mysql client still works without specifying the database (default to the name 'walkin') and mysqldump doesn't complain:

Before:

$ cat ~/.my.cnf
[client]
user=root
host=127.0.0.1
password="root"
database=walkin

After:

$ cat ~/.my.cnf
[client]
user=root
host=127.0.0.1
password="root"

[mysql]
database=walkin