Bug #54534 Inconsistaency in parameters for mysql.exe
Submitted: 15 Jun 2010 22:33 Modified: 16 Jun 2010 5:43
Reporter: Greg DeBacker Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.1 OS:Windows (XP)
Assigned to: CPU Architecture:Any
Tags: -p password, -ppassword, MySQL, restore

[15 Jun 2010 22:33] Greg DeBacker
Description:
I guess the problem for me is the lack of consistency. The -u allows a space in between it and the username, but the -p for password does not. Not only that, but if you Google 'mysql restore database' you find numerous examples of the command used with the wrong syntax. Not the fault of MySQL, but still frustrating. Also, when I used the wrong syntax I did not get an error message. What I did get was a complete list of acceptable parameters, one of which is -D database name. As a programmer I would have written it as...

mysql -u [username] -p [password] -D [database]<[inload file]

or

mysql -u[username] -p[password] -D[database]<[inload file]

How to repeat:
Type in mysql -u [username] -p [password] -D [database]<[inload file]

Suggested fix:
Use consistency in programming for parameters.
[16 Jun 2010 5:43] Sveta Smirnova
Thank you for the report.

This is not a bug. About why password option does not allow space after its name see http://dev.mysql.com/doc/refman/5.1/en/mysql-command-options.html#option_mysql_password

> Also, when I used the wrong syntax
I did not get an error message.

This is not true:

$mysql51 --wrong-option
/Users/apple/Applications/mysql-5.1/bin/mysql: unknown option '--wrong-option'