• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Communications link failure with MySQL

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Bartender
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 4116
72
Mac TypeScript Chrome Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
author
Posts: 5856
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic