Thanks,

But it doesn't help me finding out what the problem is (have a look at the
code below: it basically does the same as your example).

Let me just clarify: the application works all OK when mySQL runs on WinNT
and when I access to my files locally. The problem comes up when porting my
application to a Linux-based web server. The odd thing is that every
parameters seems to be OK (hostname, port, userID, password, etc.).

Another odd thing too is that I get a different exception (i.e.:
java.net.ConnectException) when trying to access the server as if it were
running on the same station as my java servlet (which is not the case): see
item 8/ below. I think I understand the exception I get in the case
describded in item 8/. I also understand why I get a different exception
when contacting the proper server on the proper port
(java.security.AccessControlException): so it seems that the code is going a
little further. But it also seems that it is a mySQL server error. What I
don't understand is why I get my connection refused when every parameters
are OK (and actually: I get the very same error when trying to access a
table wich doesn't exist, or a table which exists but for which I don't have
the proper rights, or the table to which I want to have access to (which
exists) but without providing the user or password). 

I'm still looking for ideas...


-----Original Message-----
From: Venu A [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 30, 2001 6:46 PM
To: SIMONIN Alexandre; [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; Mysql. Com Java@Lists.
Subject: RE: *** HELP *** mySQL connectivity problems


Check the following link, which has the simple MyJDBC sample to connect to
MySQL server and to do some basic operations.
http://lists.mysql.com/cgi-ez/ezmlm-cgi?1:mss:80228:200107:popciohjmlbbolpak
ege

If you need any further assistance, please let us know.
Thanks in advance
venu

> -----Original Message-----
> From: SIMONIN Alexandre [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 30, 2001 9:33 AM
> To: '[EMAIL PROTECTED]'
> Cc: '[EMAIL PROTECTED]'
> Subject: FW: *** HELP *** mySQL connectivity problems
>
>
>
>
> >  -----Original Message-----
> > From:       SIMONIN Alexandre
> > Sent:       Monday, July 30, 2001 2:41 PM
> > To: '[EMAIL PROTECTED]'
> > Subject:    *** HELP *** mySQL connectivity problems
> >
> > Hi,
> >
> > I'm running mySQL 2.0.4 and Tomcat 4.0 on Cobalt/Linux. I'm
> using mm 2.0.4
> >
> >
> > When trying to get a connection to the database, I got the
> following error
> > (the code is provided below - exact id and password replaced for
> > confidentiality).
> >
> > >>> Step 1 : Class.forName("org.gjt.mm.mysql.Driver"); OK
> > >>> Step 2 :
> > getConnection("jdbc:mysql://sherweb7.sherweb.com:3306/myDatabase?
> > >>>                                    user=myID&password=myPwd"); ***
> > FAILURE ***
> > >>>
> > >>>      SQLException: Cannot connect to MySQL server on
> > sherweb7.sherweb.com:3306.
> > >>>          Is there a MySQL server running on the machine/port you are
> > trying to connect to?
> > >>>          (java.security.AccessControlException)
> > >>>      SQLState: 08S01
> > >>>      VendorError: 0
> >
> > Few comments:
> > 1/ the mySQL server's site address is OK (not the localhost)
> > 2/ the mySQL server's port is OK
> > 3/ the table name is OK
> > 4/ the userID is OK
> > 5/ the password is OK
> > 6/ the connection looks fine through phpMyAdmin
> > 7/ I get the same java.security.AccessControlException when
> doing the same
> > request without the userID and password
> > 8/ I got a java.net.ConnectException (which seems normal to me) when
> > trying to call the server as if it was local to my machine, i.e.:
> > jdbc:mysql:///myDatabase?user=myID&password=myPwd
> > 9/ granting my id with all the privileges in mySQL doesn't do
> any good: I
> > can view all the tables through phpMyAdmin, but still cannot get a
> > connection.
> >
> > Any suggestion?
> >
> > The code:
> >
> >     try {
> >       Class.forName("org.gjt.mm.mysql.Driver");   // this or <the
> > same>.newInstance() does the same
> >       System.out.println("Step1:
> > Class.forName(\"org.gjt.mm.mysql.Driver\"): OK");
> >     }
> >     catch (Exception e) {
> >
> System.out.println("Class.forName(\"org.gjt.mm.mysql.Driver\"): ***
> > FAILURE ***");
> >     }
> >
> >     Connection myConn = null;
> >
> >     try {
> >       myConn =
> >
> DriverManager.getConnection("jdbc:mysql://sherweb7.sherweb.com:3306/myData
> > base?user=myID&password=myPwd");
> >       System.out.println("Step 2:
> >
> getConnection(\"jdbc:mysql://sherweb7.sherweb.com:3306/myDatabase?user=myI
> > D&password=myPwd\"): OK");
> >     }
> >     catch (SQLException e) {
> >       System.out.println("Step 2:
> >
> getConnection(\"jdbc:mysql://sherweb7.sherweb.com:3306/myDatabase?user=myI
> > D&password=myPwd\"): *** FAILURE ***");
> >      System.out.println(" SQLException: "+e.getMessage());
> >      System.out.println(" SQLState: "+e.getSQLState());
> >      System.out.println(" VendorError: "+e.getErrorCode());
> >     }
> >
> >
>
> ---------------------------------------------------------------------
> Before posting, please check:
>    http://www.mysql.com/manual.php   (the manual)
>    http://lists.mysql.com/           (the list archive)
>
> To request this thread, e-mail <[EMAIL PROTECTED]>
> To unsubscribe, e-mail
> <[EMAIL PROTECTED]>
> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
>

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to