Bug #21274 | Cannot connect to WAN database on a windows service application | ||
---|---|---|---|
Submitted: | 25 Jul 2006 13:55 | Modified: | 7 Aug 2006 8:15 |
Reporter: | Jean Bédard | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 1.0.7 | OS: | Windows (Windows 2000/XP/2003) |
Assigned to: | CPU Architecture: | Any | |
Tags: | connect;remote database;failed, windows service |
[25 Jul 2006 13:55]
Jean Bédard
[25 Jul 2006 14:48]
Tonci Grgin
Hi Jean and thanks for your problem report. I think what's happening is that not all required services are up by the time your service starts. You should probably check dependencies of your service and add required ones.
[25 Jul 2006 14:53]
Tonci Grgin
Jean, please report MySQL server versions, both for localhost and for remote.
[25 Jul 2006 15:07]
Jean Bédard
Hi Tonci, You are right, the problem seems to come from the MySQL server itself. I'm using version 5.0.15 NT. Look what I did to debug deeper: I set my service to connect to database at "test.dynip.com" on port 2003. There is a UPnp record on my router that redirect everything on port 2003 to my computer's 2003 port. So I setup a TCP Listener (that does nothing except listening and accepting incoming connection on port 2003) and I reboot the PC where my windows service is installed. Surprise, the connection is made succesfully! What I forgot to tell is that the database I'm using is on the same computer than the windows service. But I'm using a public IP address (or domain name test.dynip.com) instead of "localhost". I found that the test.dynip.com is correctly resolved (so that the DNS Client Service is correctly started). I also add a dependencies to the MySQL service wihtout any change. I fact, when using "localhost", everything works... to this is a matter of service started or not... I think. Maybe the MySQL service does not accept incomming connection from "remote" IP address when no user is actively logged into the system. Any idea ?
[7 Aug 2006 8:15]
Tonci Grgin
Hi Jean, sorry for the delay. In my opinion, MySQL server starts up before your server obtains the public IP address resulting in error you get. I don't see a bug here.