Skip navigation links

MySQL Forums


Advanced Search

Communication link failure: MySQL 5, Tomcat 6, Ubunti 8.10 Server
Posted by: Ambrose Krapacs ()
Date: November 16, 2008 11:14AM

I have a very mature web application that I have developed on my OS X machine and I have not had any problems with connecting to the MySQL database server. I recently installed 8.10 server and installed the LAMP Server and the Tomcat Servlet server. All necessary components seem to be installed and configured fine. I can log into mysql server via the command prompt and I can run access the tomcat mangager console as well as run servlets and JSPs. I've tried everything to get my servlets to connect to MySQL and I have had no success.

Mysql Server version: 5.0.67-0ubuntu6
mysql-connector-java-5.1.6-bin.jar

This is how I am attempting to connect:
Class.forName("com.mysql.jdbc.Driver");
Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/inventory?user=invuser&password=pass");

I have tried using localhost, 127.0.0.1, localhost:3306, 127.0.0.1:3306 and the results are the same. I get the same results if I am trying to run the servlet from the linux machine or from a machine on the local network.

And the exception:
Code:

com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure
Last packet sent to the server was 0 ms ago.

The most confusing part about this exception is that I receive nearly the exact same exception in OS X when I forget to start the MySql Server (i have not configure it to start automatically). However, this does not seem to be the case on my Ubuntu server because from what I can tell the MySql server is running.

Options: ReplyQuote


Subject Written By Posted
Communication link failure: MySQL 5, Tomcat 6, Ubunti 8.10 Server Ambrose Krapacs 11/16/2008 11:14AM


Sorry, you can't reply to this topic. It has been closed.