Bug #9791 Several features disabled when connecting to 127.0.0.2 ("localhost" range)
Submitted: 10 Apr 2005 14:50 Modified: 12 Apr 2005 17:46
Reporter: spaze Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Administrator Severity:S1 (Critical)
Version:1.0.19 OS:Windows (Windows XP SP2)
Assigned to: CPU Architecture:Any

[10 Apr 2005 14:50] spaze
Description:
My scenario: I have MySQL Server 4.0.24 running on localhost, 127.0.0.1:3306 to be exact, and installed MySQL Server 4.1.11 on 127.0.0.2:3306. When I connect using MySQL Administrator to 4.1 server (to 127.0.0.2) and then choose "Service Control" or "Startup Variables" I see that "This section is only available when connected to localhost" and the controls are disabled.

How to repeat:
Install 4.0.x server on your machine, stop the service, edit the config file to force the server to listen only on 127.0.0.1 as:

[mysqld]
bind-address=127.0.0.1

Install 4.1.x server on the same machine, stop the service, edit the my.ini file, so the server is listening on 127.0.0.2 only:

[mysqld]
bind-address=127.0.0.2

Start both (4.0 and 4.1) servers. netstat -an should show that there's server listening on 127.0.0.1:3306 and 127.0.0.2:3306.

Start Administrator and try to connect to 127.0.0.1, everything is ok, you are able to control the service, etc. Connect to 127.0.0.2 and the service control and startup variables are disabled.

Note, when you try to setup this configuration on Windows XP SP2 machine, you might get the MS KB884020 patch applied <http://support.microsoft.com/default.aspx?scid=kb;en-us;884020>

Suggested fix:
I think that the Administrator should not check for localhost exactly (for 127.0.0.1) but for the localhost "range", so that the 127.0.0.2 is recognized as "local" and you can still control the service and it's startup variables.

Thanks for reviewing this issue.
[12 Apr 2005 17:46] Jorge del Conde
Can you please make sure you have admin privileges in the winxp account that you're running administrator with ?

Thanks
[12 Apr 2005 22:17] spaze
I do have administrator privileges in my win account. Maybe simpler test case is to run only one MySQL server binded to all interfaces (w/o the bind-address directive in the conf file) and try to connect to localhost -- you should be able to control the service, connect to some "outer" interface (run ipconfig.exe to see the IP address) like 172.24.39.187, you should be able to control it too. But, connect to 127.0.0.2 and the "Service Control" and "Startup Variables" are disabled. You need the privileges to connect from the "outer" and 127.0.0.2 addresses, of course.
[1 Oct 2005 19:40] spaze
Back to this issue as it is still present in MA 1.1.3/Win32. I've read the source (1.1.2) and tracked it thru the MySQLConnection.pas:312

ConnectedToLocalhost := (myx_is_localhost(user_connection.hostname) = 1);

down to the ./mysql-gui-common/library/source/myx_network.c:268:

int myx_is_localhost(const char *hostname)

And it seems to me that this function simply does not take the "localhost range" (eg. mentioned 127.0.0.2) into consideration.