• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Communications link failure with MySQL

 
Mike Clarkson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i'm trying to create a java application [it's been a while since i have], and i'm trying to connect to mysql with the latest connector/J [5.1.10] and on my windows 7 machine i get the following error. but on my ubuntu laptop, it works just fine

the code i'm running is this:


on my windows machine, the error is as follows:


as i stated before, it works fine on my ubuntu machine, my debian box running mysql accepts remote connections. the only issue is trying to run from my windows 7 machine [uac turned off, eclipse run as administrator]

any help would be greatly appreciated
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If same code runs on another distribution, then there might be something with the Windows 7 (may be it blocks those incoming packets).Have you tried disabling firewall etc..?
 
Vijitha Kumara
Bartender
Pie
Posts: 3930
21
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And Welcome to JavaRanch, Mike

Happy & Prosperous New Year to all the Ranchers
 
Mike Clarkson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
my windows firewall is turned off, and when i tried to telnet to my debian machine [where mysql is] on port 3306, putty just exits with no notice. i'm wondering if it's my router that is blocking traffic, but why blocking on the windows side and not the linux side [as my laptop runs ubuntu and can connect just fine]? if it's not my router, what in windows could be blocking the connection? i have no other software firewall running, and i've even disabled my antivirus just in case. this is really confusing...

and thanks for the welcome and the new years wishes, same to you!
 
Jaikiran Pai
Marshal
Pie
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Just a guess - Usually, that exception is a result of incorrect JDBC driver jar being used for the version of the MySQL server. Are you sure the MySQL server on your Windows system is the same as the one on Ubuntu and the driver jar you are using on Windows is the right one?
 
Mike Clarkson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i don't have a mysql server on my windows machine or on my ubuntu machine. it's only installed on my debian machine. ubuntu can connect to mysql just fine, windows can not for some reason.

Versions:
mysql: 5.0.51a [standard from the debian lenny repos]
connector/j: 5.1.10
java: 1.6.0.14 [on windows] and 1.6.0.15 on my ubuntu machine

i wonder if that minor revision of java is the problem...

thanks for the suggestions!
 
Peter Johnson
author
Bartender
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
From the Windows machine, try running this and see what you get:

telnet 192.168.1.150 3306

You should get some garbage characters back. (You can close the connection using CTRL-Z)

If that works, try installing the MySQL GUI tools on your windows box and connect to the database using them. You will probably have to add your Windows IP address as an allowed root host in MySQL.

Finally, look at the the hosts file on the Windows machine, and on the Debian machine. An invalid hosts file can cause strange communications problems like what you are seeing. You can post the hosts files if the error is not obvious.

One more thought - try turning off IPv6 in Windows 7 - it is on by default.
 
Mike Clarkson
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
it works now, for some reason denyhosts had my internal ip for my windows machine blocked. i removed it and all is working.

thanks for all the help! this community seems pretty awesome so far!

mike
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic