Bug #21344 Unexpected behavior from mysql -hunknown.host.name
Submitted: 29 Jul 2006 19:13 Modified: 31 Aug 2006 16:10
Reporter: Bernhard Rosenkraenzer Email Updates:
Status: No Feedback Impact on me:
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0.22 OS:Ark Linux
Assigned to: CPU Architecture:Any
Tags: mysql -h, unknown host name

[29 Jul 2006 19:13] Bernhard Rosenkraenzer

mysql -h unknown.host.name

tries to connect to a mysql server on the local machine instead of giving an error message that unknown.host.name can't be resolved.

This can be a big problem while debugging -- we've just spent half an hour debugging our "grant" statements because we kept getting access denied, when in fact the problem was that we've forgotten to add the new db server to the DNS. (We kept getting "access denied" because the mysql server running on the local machine uses different passwords...)

How to repeat:
Simply run

mysql -hhost.that.does.not.exist

Suggested fix:
none yet
[31 Jul 2006 16:13] Valeriy Kravchuk
Thank you for a problem report. Why do you think mysql connects to your local machine? Do you have any evidence? Look:

openxs@suse:~/dbs/5.0> bin/mysql -hunknown.host.name -uroot test
ERROR 2003 (HY000): Can't connect to MySQL server on 'unknown.host.name' (111)

Exactly what was expected.
[31 Aug 2006 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".