Pergunta

I am trying to connect to a remote mysql database but I get the following error

java.sql.SQLException: Cannot connect to MySQL server on biomancy.com:3306. Is
here a MySQL server running on the machine/port you are trying to connect to? (
ava.lang.NumberFormatException)
        at org.gjt.mm.mysql.Connection.connectionInit(Unknown Source)
        at org.gjt.mm.mysql.jdbc2.Connection.connectionInit(Unknown Source)
        at org.gjt.mm.mysql.Driver.connect(Unknown Source)
        at java.sql.DriverManager.getConnection(DriverManager.java:582)
        at java.sql.DriverManager.getConnection(DriverManager.java:185)
        at cliche.database.ClicheDBManager.<init>(ClicheDBManager.java:33)
        at cliche.server.ClicheExtension.init(ClicheExtension.java:43)

The code in the init function trigger this chain is simply:

myConnection = DriverManager.getConnection(connectionString, user, pass);

I can connect to the database using the commandline mysql from this same computer just fine using the same credentials, and it let me know I had the password wrong when I tried with the wrong password.

Thank you in advance for your help, I hope I gave enough information here.

Foi útil?

Solução

My best guess is the driver is not the right version. Double check that you have a current version of the driver or try a different driver. Also double check that mysql running on the default port (3306).

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top