Error in mysqldump: mysqldump: [ERROR] unknown variable 'database=someDb'

Viewed 9420

I am getting the following error:

 mysqldump: [ERROR] unknown variable 'database=myDB1'

when I run this command:

 mysqldump -u root -p myDB2  > someFile

There is a db by the name myDB1 and of course, a db by the name myDB2.

This worked before (or so I think). I do not recollect changing my.cnf or any other configuration file.

1 Answers

Your problem is likely related with ~/.my.cnf. You've probably set database option in ~/.my.cnf file like database=somedatabase in [client] group instead of in [mysql] group.

Related