Bug #14071 mysql -u root mysql
Submitted: 17 Oct 2005 12:26 Modified: 17 Oct 2005 12:31
Reporter: frank vanderydt Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.013 rc OS:Windows (Win XP SP2)
Assigned to: CPU Architecture:Any

[17 Oct 2005 12:26] frank vanderydt
Description:
In CLI i try as found in manual :

Mysql -u root mysql

Result : ERROR 1045 (28000): Access denied for user 'root'@'localhost'

so i'm trying to connect to the server, but this is not working.

How to repeat:
Repeating is easy

Mysql -u root PASS

Suggested fix:
Mysql -u root -p
Enter Password: ***** (mysql)

This one works... so i think the other option with password in the syntax is not working or disabled. Took me 1 hour on the net to solve this.
I was upgrading from an older version 4 so this was very confusing.
[17 Oct 2005 12:31] Valeriy Kravchuk
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.mysql.com/documentation/ and the instructions on
how to report a bug at http://bugs.mysql.com/how-to-report.php

Additional info:

It is clearly describe in the manual (http://dev.mysql.com/doc/refman/5.0/en/mysql-command-options.html):

"--password[=password], -p[password]

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."

mysql was interpreted as a database name, not as a password. And your root user has a password, that should be provided.