• 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

Cannot connect to MySQL5 with connector-java

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Does anyone have an idea, why can't I connect to MySQL5 with neither mysql-connctor-java 3.12.x, nor mysql-connector-java 5.x (dev version)?

I can connect to MySQL4.1.11 using any of the drivers, but when I try to connect to a MySQL5 db using the same code and syntax, it fails:
"STACKTRACE:
java.net.SocketException: java.net.ConnectException: Connection refused"

The MySQL log is empty. MySQL server listens on the standard 3306 port. I'm using Linux boxes running jre1.5.0_06-b05. Access righs, passwords, etc are OK, servers are runnig , no firewalls in the way, I can connect to them with other non-java clients.

What am I doing wrong?

Regards,
Brian
 
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If it's a new installation, you should look in the "my.cnf" file
(/etc/mysql/my.cnf on my computer but it might be somewhere else)
The line wich says "skip-networking" should be commented (#skip-networking) in order for jbdc to work.
 
Gergo Csaki
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
No, it's not a new installation.
Other clients can connect using both tcpip and socket (localhost or 127.0.0.1) so this shouldn't be the problem :-(
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic