views:

38

answers:

1

I run the following command from the Windows command line to backup my database:

...\right_path\mysqldump --add-drop-database --databases my_database_name
                         --defaults-extra-file=d:\1.cnf

where d:\1.cnf contains the following:

[client]
user="my_user"
password="my_password"

Unfortunately, I got the following error message:

mysqldump: unknown variable 'defaults-extra-file=d:\1.cnf'

If I do:

...\right_path\mysqldump --add-drop-database --databases my_database_name
                         --user="my_user" --password="my_password"

it works as expected.

What am I doing wrong ?

A: 

I found the answer: --defaults-extra-file must be the first option. This works as expected:

...\right_path\mysqldump --defaults-extra-file=d:\1.cnf
                         --add-drop-database --databases my_database_name
Misha Moroshko