Bug #16600 print defaults but does not use it
Submitted: 18 Jan 2006 10:43 Modified: 19 Jan 2006 8:48
Reporter: Martin Schlothauer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S3 (Non-critical)
Version:Ver 14.12 Distrib 5.0.18, for Win32 (ia3 OS:Windows (Win XP)
Assigned to: CPU Architecture:Any

[18 Jan 2006 10:43] Martin Schlothauer
Description:
C:\Programme\MySQL\MySQL Server 5.0\bin>mysql --print-defaults
mysql would have been started with the following arguments:
--host=ws1.lgb. --port=3306 --user=martin --password= --silent

C:\Programme\MySQL\MySQL Server 5.0\bin>mysql
ERROR 1045 (28000): Access denied for user 'martin'@'pc1.lgb.local' (using passw
ord: NO)

Without options mysql should use the default host and not connect to the 
local machine 

How to repeat:
use a machine that has no Server running and write in the 
my.ini another server
[18 Jan 2006 15:59] Valeriy Kravchuk
Thank you for a problem report. Why do you think that it is connecting to a local machine? Please, send the "ipconfig /all" command results from the same command line window you ran mysql.
[19 Jan 2006 7:21] Martin Schlothauer
The Errormessage shows mysql is trying to connect to the same computer (pc1.lgb.local).
I expect the user and host from --print-defaults  'martin'@'ws1.lgb' 

C:\Programme\MySQL\MySQL Server 5.0\bin>ipconfig /all

Windows-IP-Konfiguration

        Hostname. . . . . . . . . . . . . : pc1
        Primäres DNS-Suffix . . . . . . . : lgb.local
        Knotentyp . . . . . . . . . . . . : Unbekannt
        IP-Routing aktiviert. . . . . . . : Nein
        WINS-Proxy aktiviert. . . . . . . : Nein
        DNS-Suffixsuchliste . . . . . . . : lgb
                                            lgb.local

Ethernetadapter LAN-Verbindung 2:

        Verbindungsspezifisches DNS-Suffix:
        Beschreibung. . . . . . . . . . . : Broadcom NetXtreme Gigabit Ethernet
        Physikalische Adresse . . . . . . : 00-0C-76-51-9F-5B
        DHCP aktiviert. . . . . . . . . . : Nein
        IP-Adresse. . . . . . . . . . . . : 10.133.0.64
        Subnetzmaske. . . . . . . . . . . : 255.255.255.0
        Standardgateway . . . . . . . . . : 10.133.0.1
        DNS-Server. . . . . . . . . . . . : 10.133.3.11
                                            10.133.0.66
[19 Jan 2006 7:38] Valeriy Kravchuk
Your interpretation fo the error message is wrong:

C:\Programme\MySQL\MySQL Server 5.0\bin>mysql
ERROR 1045 (28000): Access denied for user 'martin'@'pc1.lgb.local' (using
password: NO) 

It is your (remote) server denies access to the user martin who tried to connect from pc1.lgb.local, that is, your local host, without password. I believe, you have no access rights granted on your server to this (remote) user!

Send the results of the following statement from your server, if you want:

select user, host from mysql.user;

It will explain everything.
[19 Jan 2006 8:48] Martin Schlothauer
Yes, You are right.
After  adding a line
password 
to the my.ini i can connect.

Thank you for the Help