On Nov 18, 2008, at 7:37 , André Warnier wrote:

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
Hi.
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: users@tomcat.apache.org
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


I have verified that MySQL is running on the correct port. In /etc/ conf/my.cnf the bind-address is 127.0.0.1 and the port specified is 3306. I was able to get the standalone j2se application to connect to the MySQL server using the JDBC connector so tomcat should be running. I'm trying to set up both Tomcat and MySQL on the same system but during my troubleshooting I tried to set up another server with MySQL and I could not connect to that server either through Tomcat (same result). I've checked the /etc/hosts file to make sure that there is an entry for localhost, and pinging localhost seems to return expected results. Also, I have tried using telnet to connect to port 3306 and it does appear that the server is listening because it refuses the telnet connection.

Reply via email to