10 messages in com.mysql.lists.javaRE: connecting with a password
FromSent OnAttachments
Eric Muntz01 Feb 2001 11:11 
Gary Bentley01 Feb 2001 11:42 
Kent Vanderwaal01 Feb 2001 11:50 
Igor Fedulov01 Feb 2001 11:54 
Gary Bentley02 Feb 2001 01:43 
Eric Muntz02 Feb 2001 06:49 
Tomasz Pawlowski02 Feb 2001 07:26 
Eric Muntz02 Feb 2001 08:05 
Paul DuBois02 Feb 2001 09:33 
Gary Bentley02 Feb 2001 09:52 
Subject:RE: connecting with a password
From:Gary Bentley (gb@opengroup.org)
Date:02/01/2001 11:42:13 AM
List:com.mysql.lists.java

I've had similar problems, if anyone has a solution please let us know!!!

I did think it was an encryption problem but I've tried it encrypted and it didn't work, the frustrating thing is that it works fine from the command line...

G.

-----Original Message----- From: Eric Muntz [mailto:Eric@zapmedia.com] Sent: Thursday, February 01, 2001 7:12 PM To: ja@lists.mysql.com Subject: connecting with a password

I'm having no luck connecting via JDBC when a password is set. I've set the password for a user 'eric' to be 'passwd'. I changed this in mysql.user table, I also added 'eric' to mysql.db table for the database I'm using. I can get in from the command line with the 'mysql' tool and run selects on my database. When I try to connect from java I get

SQLException: while opening connection: Communication link failure: Bad handshake

A note: There was an e-mail that went around recently that seemed like a similar problem in which the Host needed to be set to '%' to gain access. I have done this and reloaded and even stopped/started mysql.

Also, it connects fine if I give user 'eric' no password.

My connection string looks like this: "jdbc:mysql://localhost/mydb?user=eric&password=passwd"

Are there any ideas as to what's going on??

I've tried this in Win2000 and RedHat6.2, running mysql 3.23.32 under java1.1.8 (Sun on Windows, IBM on Linux) and the MM driver.

thanks for any advice! -Eric