23

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'
2
  • 1
    You've probably checked this already, but nothing to be found in /etc/my.cnf or /etc/mysql/conf.d or similar locations? – Martijn Heemels Feb 23 '15 at 9:34
  • Post your /etc/my.cnf (and its includes) and $HOME/.my.cnf files. – Michael Hampton Feb 23 '15 at 12:47
30

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
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.