Mysqldump complains about chosen databases regardless of command line

Solution 1:

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