error to connect a DB

Hi, I need help with my problem:

Simply I have a java class (made with Eclipse) where .

In the main method I call to the constructor where I try to connect with a MySQL Data Base, this is my code, and my exception:

package es;

import java.lang.reflect.InvocationTargetException;

import java.sql.*;

import java.util.ArrayList;

import java.util.List;

.....

publicclass MyConnection{

Connection dbconn;

ResultSet results;

PreparedStatement sql;

public MyConnection(){

try

{

Class.forName("org.gjt.mm.mysql.Driver");

try{

dbconn = DriverManager.getConnection("jdbc:mysql://localhost:3306/paleodbtemp?user=root&password=123456");

}catch (SQLException s)

{

System.out.println("Error conexion DB: "+s);

}

}catch (ClassNotFoundException err)

{

System.out.println("Class loading error: "+err);

}

}

....

publicstaticvoid main(String[] args){

new MyConnection();

....

}

}

The Exception is:

Error conexion DB: java.sql.SQLException: Communication failure during handshake. Is there a server running on localhost:3306?

Why this error?

[2246 byte] By [jesusmgmarina] at [2007-11-27 2:29:16]
# 1

dbconn = DriverManager.getConnection("jdbc:mysql://localhost:3306/paleodbtemp?user=root&password=123456");

It asks if a server is running on localhost:3306.

Seems there isn't a server running MySQL on your localhost at post 3306, after seeing the error

Make sure that your location is right (maybe a different port?)

Or even check if the database is MySQL

radicjesa at 2007-7-12 2:42:15 > top of Java-index,Java Essentials,Java Programming...