tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Servlets / JSP can't connect to MySQL in Ubuntu Server
Date Tue, 18 Nov 2008 12:37:49 GMT
Krapacs Ambrose wrote:
> I have tried many different configurations and I have been unable to get 
> my Servlets / JSP to connect to MySQL server running. I am trying to get 
> this set up on my main server which is running Ubuntu 8.10 Server with 
> MySQL 5 and Tomcat6. I also tried setting up a Ubuntu 8.04 server with 
> Tomcat 5.5 and MySQL 5. I have even configured Tomcat running on the 
> 8.10 server to try to connect to MySQL running on the 8.04 server. Still 
> no luck!
> The exception that is thrown is here:
>     com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: 
> Communications link failure
I know little about MySQL and JDBC, but the above seems to be purely at 
the TCP/IP level : your JDBC driver cannot connect to your MySQL server.

It seems from the above that you are connecting to "localhost" without 
indicating a port. I thus suppose that JDBC is going to try the 
"standard port" on which MySQL is supposed to be listening.
1) So first of all, is that the case ? Is MySQL really listening on that 
port ? (and first of all, is MySQL started ?)
(Try "netstat -n | grep LISTEN" to see all ports being listened on)

2) are your Tomcat and your MySQL server on the same system ? (since 
you're trying to connect to "localhost")

3) if yes, on that system, when you try "ping localhost", what does it 
show you ?

4) finally, on the same system, try "telnet localhost xxxx", where xxxx 
is the port where MySQL is supposedly listening.  What do you see then ?

To start a new topic, e-mail:
To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message