I'm trying to use
$ mysqldump -u test -h myhost --no-data --tables --password lose
-- MySQL dump 10.10
mysqldump: Got error: 1044: Access denied for user 'test'@'%' to
database 'lose' when selecting the database
mysqldump Ver 10.10 Distrib 5.0.22, for pc-linux-gnu (i486)
From man mysqldump:
The password to use when connecting to the server. If you use the short option form (-p), you cannot have a space between the option and the password. If you omit the password value following the --password or -p option on the command line, you are prompted for one.
Specifying a password on the command line should be considered insecure. See Section 6.6, "Keeping Your Password Secure".
Syntactically, you are not using the --password switch correctly. As such, the command line parser is seeing your use of "lose" as a stand-alone argument which mysqldump interprets as the database name as it would if you were to attempt a simpler command like
To correct this, try using
-plose or simply use
--password and type the password when prompted.