Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

mysql

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.

like image 354
asinix Avatar asked Jan 03 '19 15:01

asinix


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.

like image 115
El_Dorado Avatar answered Nov 16 '22 09:11

El_Dorado