SocketException

User bd188fbc36

19-09-2005 22:12:18

Hi,





I get the following error:





17:49localhost>com.mysql.jdbc.CommunicationsException: Communications link failure due to underlying exception:





** BEGIN NESTED EXCEPTION **





java.net.SocketException


MESSAGE: java.net.ConnectException: Connection refused





STACKTRACE:





java.net.SocketException: java.net.ConnectException: Connection refused


at com.mysql.jdbc.StandardSocketFactory.connect(StandardSocketFactory.java:156)


at com.mysql.jdbc.MysqlIO.<init>(MysqlIO.java:283)


at com.mysql.jdbc.Connection.createNewIO(Connection.java:2541)


at com.mysql.jdbc.Connection.<init>(Connection.java:1474)


at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264)


at java.sql.DriverManager.getConnection(DriverManager.java:525)


at java.sql.DriverManager.getConnection(DriverManager.java:171)


at chemaxon.util.ConnectionHandler.setConnected(ConnectionHandler.java:206)


at chemaxon.util.ConnectionHandler.connect(ConnectionHandler.java:246)


at chemaxon.jchem.gui.Connector.go(Connector.java:95)


at chemaxon.jchem.gui.JChemFrame.connect(JChemFrame.java:561)


at chemaxon.jchem.JChemManager.init(JChemManager.java:89)


at chemaxon.jchem.JChemManager.main(JChemManager.java:106)








** END NESTED EXCEPTION **











Last packet sent to the server was 44 ms ago.


at com.mysql.jdbc.Connection.createNewIO(Connection.java:2607)


at com.mysql.jdbc.Connection.<init>(Connection.java:1474)


at com.mysql.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:264)


at java.sql.DriverManager.getConnection(DriverManager.java:525)


at java.sql.DriverManager.getConnection(DriverManager.java:171)


at chemaxon.util.ConnectionHandler.setConnected(ConnectionHandler.java:206)


at chemaxon.util.ConnectionHandler.connect(ConnectionHandler.java:246)


at chemaxon.jchem.gui.Connector.go(Connector.java:95)


at chemaxon.jchem.gui.JChemFrame.connect(JChemFrame.java:561)


at chemaxon.jchem.JChemManager.init(JChemManager.java:89)


at chemaxon.jchem.JChemManager.main(JChemManager.java:106)





This is obtained with:


1. MySQL connection id is 9 to server version: 4.1.11


2. JDBC: either mysql-connector-java-3.1.10-bin.jar or mysql-connector-java-3.2.0-alpha-bin.jar (same result)


3. jakarta-tomcat-5.5.9


4. jchem-3.1


5. Apache: either apache2-2.0.53 or 1.3





Not sure what is going on. Used to work before upgrade of apache and mysql... but now neitehr jcman nor jchem application work with the same error. When I go directly to mysql all parts seem to be fine inside. Apparently the connection is broken. By the way classpath to mysql-connector-....jar is taken care, of course.





Any ideas what is going on?





Thank you.

ChemAxon 9c0afc9aaf

20-09-2005 06:11:50

Hi,





This kind of error is usually thrown when the MySQL server is down or unreachable.





Please check the following:





- The MySQL server is running


- You have enabled TCP/IP networking for the server during setup on an appropriate port (default port is 3306 )


- Your URL points to the correct host (and to the correct port, if not the default used)


- There is no firewall that prevents the communication between jcman and the MySQL server on this port





Best regards,





Szilard

User bd188fbc36

21-09-2005 01:30:39

Hi Szilard,





You are right. I fixed that. Here is another hurdle. Now upon connecting to the port MySQL reports:





HY000Host '127.0.0.1' is not allowed to connect to this MySQL server





The host table was empty. I added





INSERT INTO host (Host,Db,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,References _priv,Index_priv,Alter_priv) VALUES ('localhost','%','Y','Y','Y','Y','Y','Y',',Y','Y','Y','Y');


INSERT INTO host (Host,Db,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,References _priv,Index_priv,Alter_priv) VALUES ('localhost.localdomain','%','Y','Y','Y','Y','Y','Y',',Y','Y','Y','Y');


INSERT INTO host (Host,Db,Select_priv,Insert_priv,Update_priv,Delete_priv,Create_priv,Drop_priv,Grant_priv,References _priv,Index_priv,Alter_priv) VALUES ('127.0.0.1','%','Y','Y','Y','Y','Y','Y',',Y','Y','Y','Y');





but none of these helped... Any suggestions?





Thank you.

ChemAxon 9c0afc9aaf

21-09-2005 08:05:23

Hi,





I don't know what can be the problem.





I have never received such an error, and I didn't have to execute similar insert statements to make MySQL work either.





Since you problems started with the replacement of your MySQL installation, reinstalling MySQL (either the same or an other version) might be a good idea.





For further help please refer to the documentation and forum on the MySQL site.





Best regards,





Szilard