Bug #36273 Login not accepted with password in mysql 5.1.24 RC community ( Non-Maria )
Submitted: 23 Apr 2008 3:59 Modified: 5 May 2008 20:44
Reporter: Sharad Kelkar Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server Severity:S2 (Serious)
Version:5.1.24 RC Community OS:Windows (XP Service Pack 2)
Assigned to: CPU Architecture:Any
Tags: login, not accepted, password

[23 Apr 2008 3:59] Sharad Kelkar
Description:
Server Version:   MySQL Community 5.1.24 RC ( Regular build NOT Maria )
Operating System: MS Windows XP Service Pack 2 Installed..
I download pre-compiled binary and extract to C:\ and install mysql as system service.
After login as root,
I create users in MySQL Console with command:
CREATE USER `abc`@`%` IDENTIFIED BY 'xyz' ;
This should create user abc with password xyz  for that user, as documented in the manual.
Now, I try to login in mysql console as user abc at command prompt:
C:\mysql\bin >  mysql --user=abc --password=zyz
My Login is rejected !
Surprisingly  when I try to login without supplying password I am successful in login !
mysql  - u abc  OR mysql --user=abc   ( Without typing supplying password  here )
This creates problem for my Java / JDBC  based web application which supply password.
This is first time observed in 5.1.24 RC, which was not the case with 5.1.22 RC which I am using right now.

Thanks and regards
Sharad Kelkar ( drsskelkar@gmail.com )

How to repeat:
Try to connect via JDBC supplying username and password, your login will be rejected.
[1 May 2008 12:11] Sveta Smirnova
Thank you for the report.

Please login as mysql  - u abc, run SELECT USER(), CURRENT_USER(); and provide us outptu of this query.
[2 May 2008 5:55] Sharad Kelkar
As requested by executive in charge of this bug (Sveta Smirnova) I am sending output of the the query: SELECT USER(), CURRENT_USER() after login with user abc and no password supplied
The output : abc@localhost, abc@localhost 

I could login without password as mysql -u abc ,
but with password mysql -u abc -p failed. ( even after supplying correct password)
[5 May 2008 20:44] Sveta Smirnova
Thank you for the feedback.

You meet problem described at http://dev.mysql.com/doc/refman/5.1/en/connection-access.html

Please start reading from "When multiple matches are possible, the server must determine which of them to use. It resolves this issue as follows"
[13 Jun 2008 12:41] Susanne Ebrecht
Bug #36273 is set as duplicate of this bug here.
[13 Jun 2008 12:42] Susanne Ebrecht
Sorry typo. I meant:

bug #37369 is a duplicate of this bug here.
[13 Jun 2008 12:48] Susanne Ebrecht
One short explanation:

When you make:

$ mysql -u something -p

of course there is a check if the password is correct and you will get a rejection if it is wrong.

When you make:

$ mysql -u something

you will get a connection. But when the user 'something' don't have grants the user can't do or see something.

Just make then:
mysql> show grants;

and you will see that the user isn't allowed to do anything.

And please, don't write a bug report more then one time.
[21 Nov 2008 10:51] zaffi zarbiv
i had the same bug (or "wierd feature").
my mysql version came preconfigured with Wamp:
"Server version: 5.0.51b-community-nt MySQL Community Edition (GPL)"

i simply deleted the empty user records:
logged in as root,

use mysql
delete from user where user='';

i hope it won't hurt other functionality, as i don't know why these records where added in the first place! but so far - so good.