[MDEV-6190] Wrong host/IP address is printed back after ERROR 1045 (28000) Created: 2014-04-30  Updated: 2014-04-30  Resolved: 2014-04-30

Status: Closed
Project: MariaDB Server
Component/s: None
Affects Version/s: 5.5.36
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Martin Tournoij (Inactive) Assignee: Unassigned
Resolution: Not a Bug Votes: 0
Labels: None
Environment:

Linux martin-xps2 3.14.1-1-ARCH #1 SMP PREEMPT Mon Apr 14 20:40:47 CEST 2014 x86_64 GNU/Linux

mysql Ver 15.1 Distrib 5.5.36-MariaDB, for Linux (x86_64) using readline 5.1



 Description   

[~]% mysql -u root -h 192.168.33.10 -p
Enter password: (I enter the wrong password)
ERROR 1045 (28000): Access denied for user 'root'@'192.168.33.1' (using password: YES)
Exit 1

I enter 192.168.33.10, yet it echoes back 192.168.33.1?

It does seem to connect to the right address, though:

[~]% mysql -u root -h 192.168.33.1 -p
Enter password: 
ERROR 2003 (HY000): Can't connect to MySQL server on '192.168.33.1' (111)
Exit 1

It does seem to with the MySQL on the server:

[~]% mysql -u root -h 192.168.33.10 -p  
Enter password: 
ERROR 1045 (28000): Access denied for user 'root'@'192.168.33.10' (using password: NO)
 
[~]% mysql --version
mysql  Ver 14.14 Distrib 5.5.35, for debian-linux-gnu (i686) using readline 6.2



 Comments   
Comment by Elena Stepanova [ 2014-04-30 ]

What is your topology, exactly?
Did you run the client on the same machine both times?
Is the server running on the same machine where you launch the client?
And are you running both MariaDB and MySQL on the same machine in turns?

Please keep in mind that when you provide an address on the command line (-h host), you indicate where to connect to, where the server is running.
When you are getting "Can't connect to", it's also where the client tried to connect to, the location of the server as you indicated it.
But when you are getting "Access denied for user@host", it's where the client tried to connect from.

So, if your server and client are running on different hosts, naturally the messages will contain the different addresses.

Comment by Martin Tournoij (Inactive) [ 2014-04-30 ]

> When you are getting "Can't connect to", it's also where the client tried to connect to, the location of the server as you indicated it.
> But when you are getting "Access denied for user@host", it's where the client tried to connect from.

Indeed. This is how MySQL authentication works >_< ... This bug report is phenomenally stupid. I just got confused, which apparently didn't clear up in the course if filing this report.

I owe everyone who wasted their time reading this report a beer.

Generated at Thu Feb 08 07:10:02 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.