MySQL: 08S01 'Connection refused' while connecting via Java apps from my PC to any database -


i wrote java servlet (which launched on local apache server on pc) connects sql database information. happens standard way:

connection conn = drivermanager.getconnection("jdbc:mysql://***.******.pl", "login", "password"); 

to run servlet, type web browser:

http://localhost:8080/sqlquery 

but gives no result , servlet displays sql exception:

com.mysql.jdbc.exceptions.jdbc4.communicationsexception: communications link failure   last packet sent server 0 milliseconds ago. driver has not received packets server.     @ sun.reflect.nativeconstructoraccessorimpl.newinstance0(native method)     @ sun.reflect.nativeconstructoraccessorimpl.newinstance(nativeconstructoraccessorimpl.java:62)     ... caused by: java.net.connectexception: connection refused: connect     @ java.net.dualstackplainsocketimpl.connect0(native method)     ... 

it's common problem no of found solutions helpful me. people suggest change bind-address 0.0.0.0 in /etc/mysql/my.cnf or open 3306 port in firewall work on windows 8.1, not on linux. also, firewall turned off. what's more, have standalone java app connects database similar way , same error occurs. connect pc internet in different places routers aren't guilty. add, few months ago app worked perfectly. probable reason pc have no idea happened. turned off both antivirus protection , firewalls (the system firewall , 1 bitdefender total security 2015) didn't help. have okayfreedom vpn turned off while testing.

by way, sentence "the last packet sent ... driver has not received packets server." mean connection established , query send no response returned or connection didn't start? tried change login , password in arguments of getconnection method not correct, nothing changed.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -