7 messages in com.mysql.lists.javaRe: cannot connect to mysql server
FromSent OnAttachments
matthew yee-king30 Aug 2002 03:53 
matthew yee-king30 Aug 2002 04:20 
Bryan Bateman30 Aug 2002 06:09 
matthew yee-king30 Aug 2002 06:35 
Peter T. Abplanalp30 Aug 2002 07:21 
matthew yee-king30 Aug 2002 07:41 
Peter T. Abplanalp30 Aug 2002 07:59 
Subject:Re: cannot connect to mysql server
From:Bryan Bateman (brya@earthlink.net)
Date:08/30/2002 06:09:33 AM
List:com.mysql.lists.java

I too was having problems connecting to a remote host. I loaded MySQL on the same machine and had no problems. Is there a limitation to the driver that only lets it connect via localhost? I noticed that, no matter what I designated as a host in my url, the error message always refered to localhost.

----- Original Message ----- From: "matthew yee-king" <yeek@no-future.com> To: <ja@lists.mysql.com> Sent: Friday, August 30, 2002 7:21 AM Subject: Re: cannot connect to mysql server

I now know that its definitely a problem with my mysql server setup.

I can connect to a remote server with the java code below just fine.

Any ideas why i've got command line mysql access and php mysql access, but not java?

Some debian mysql issue?

cheers

matthew

On Fri, 30 Aug 2002 11:53:43 +0100 matthew yee-king <yeek@no-future.com> wrote:

I'm sure this ones appeared many times before, but the mailing list archive doesn't appear to be searchable.

(am i wrong - is there a url where i can search the mailng list? )

Having problems connecting to my mysql server.

running

$ java -version java version "1.3.1" Java(TM) 2 Runtime Environment, Standard Edition (build Blackdown-1.3.1-02b-FCS) Java HotSpot(TM) Client VM (build Blackdown-1.3.1_02b-FCS, mixed mode)

mysql Ver 11.16 Distrib 3.23.49, for pc-linux-gnu (i686)

Driver.java,v 1.3 2002/05/16 20:30:57

on debian woody/ testing (using the mysql-server available as a .deb )

- i can connect fine using command line client. (e.g. mysql -u <username> -h localhost -P 3306 -p - i can connect fine using php scripts - i can't connect using a java program:

- running this code:

Class.forName("com.mysql.jdbc.Driver").newInstance(); Connection conn =

DriverManager.getConnection("jdbc:mysql://localhost:3306/", "<username>", "<password>");

-or- Connection conn =

DriverManager.getConnection("jdbc:mysql://localhost:3306/test", "<username>", "<password>");

- i get this error:

java.sql.SQLException: Cannot connect to MySQL server on localhost:3306.

Is there a MySQL server running on the machine/port you are trying to connect to? (java.net.ConnectException)

can anybody help me?

cheers

matthew

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java@lists.mysql.com instead.

To unsubscribe, send a message to the address shown in the List-Unsubscribe header of this message. If you cannot see it, e-mail java@lists.mysql.com instead.