Erro! MySQL conexão c/ Java!

4 respostas
J

Estou tentando conectar o banco MySQL ao Java mas ta dando o seguinte erro.

[color=“red”]Communication failure during handshake. Is there a server running on localhost:3306?[/color]

Parte do código.

String url = "jdbc:mysql://localhost:3306/upis/";
String user = "root";
String password = "12345678";

Class.forName("org.gjt.mm.mysql.Driver").newInstance(); 
Conn = DriverManager.getConnection(url,user,password);

Alguem sabe que erro e esse !!!

Tenho instalado o Apache2Triad.

[size=“11”][color=“red”]* Editado: Lembre-se de utilizar BBCode em seus códigos[/color][/size] :joia:

4 Respostas

M

ahm… veja bem o erro, o MySQL esta startado? …:roll:

J

Como resolvo isso??

M

:ynor: bah tchê…

…starta o MySQL.

J

Estou com o MySQL aberto.

Tela.


Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 48 to server version: 4.1.11-log

Type ‘help;’ or ‘\h’ for help. Type ‘\c’ to clear the buffer.

mysql> _


Criado 26 de maio de 2005
Ultima resposta 26 de mai. de 2005
Respostas 4
Participantes 2