You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by ar...@india-today.com on 2000/08/08 12:53:54 UTC

SQL Exception (same error) (fwd)

Please ignore if it has already been delivered..
Thanx
Anand

---------- Forwarded message ----------
Date: Tue, 8 Aug 2000 14:22:02 +0530 (IST)
From: araman@india-today.com
To: Tomcat <to...@jakarta.apache.org>
Subject: SQL Exception (same error)

Hi again
After reading all ur mails i tried to the following

1.	create a fresh user in the mysql database
	
	GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON subscriptions.* to subs@localhost identified by 'some_pass';

2.	create a sample application and test connectivity to the database
	
	import java.sql.*;
	
	public class trial {
		Connection conn;
		Statement stmt;

		public static void main(String args[]) {
			trial tr = new trial();
			String DBURL="jdbc:mysql:localhost///subscriptions";
			try{
				Class.forName("org.gjt.mm.mysql.Driver");
				tr.conn=DriverManager.getConnection(DBURL,"subs","some_pass");
				tr.stmt=tr.conn.createStatement();
				System.out.println("In connect");
				System.out.println(tr.stmt);
			} catch(Exception ex){
				System.out.println(ex.toString());
			}
		}
	}

3.	On compiling and excuting I still manage to get the following error

	java.sql.SQLException: Server configuration denies access to data source

Why is this coming.. I have gone over the privileges table many times and everything seems to be fine..  I am also able to connect to the database using the mysql client and the same login and passwd..  

This thing is totally driving me up the wall if ay one of u could tell me why it is happening so..

Thanx for ur time
Anand Raman




Re: SQL Exception (same error) (fwd)

Posted by Brian Richards <nc...@pobox.com>.
Did you flush the permissions?  "mysqladmin reload"

-Brian
----- Original Message -----
From: <ar...@india-today.com>
To: "Tomcat" <to...@jakarta.apache.org>
Sent: Tuesday, August 08, 2000 6:53 AM
Subject: SQL Exception (same error) (fwd)


> Hi again
> After reading all ur mails i tried to the following
>
> 1. create a fresh user in the mysql database
>
> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON subscriptions.* to
subs@localhost identified by 'some_pass';
>
> 2. create a sample application and test connectivity to the database
>
> import java.sql.*;
>
> public class trial {
> Connection conn;
> Statement stmt;
>
> public static void main(String args[]) {
> trial tr = new trial();
> String DBURL="jdbc:mysql:localhost///subscriptions";
> try{
> Class.forName("org.gjt.mm.mysql.Driver");
> tr.conn=DriverManager.getConnection(DBURL,"subs","some_pass");
> tr.stmt=tr.conn.createStatement();
> System.out.println("In connect");
> System.out.println(tr.stmt);
> } catch(Exception ex){
> System.out.println(ex.toString());
> }
> }
> }
>
> 3. On compiling and excuting I still manage to get the following error
>
> java.sql.SQLException: Server configuration denies access to data source
>
> Why is this coming.. I have gone over the privileges table many times and
everything seems to be fine..  I am also able to connect to the database
using the mysql client and the same login and passwd..
>
> This thing is totally driving me up the wall if ay one of u could tell me
why it is happening so..
>
> Thanx for ur time
> Anand Raman
>
>
>
>
>
>


Re: SQL Exception (same erro) (SOLVED)

Posted by Peter Bowyer <pe...@unica.co.uk>.
Not really a Tomcat issue, but....

mySQL will allow an operation if there is a GRANT in place for either the
source IP address or the resolved FQDN of the source IP address. Since there
can be multiple entries for any given username / ip or hostname combination,
I guess it does a reverse lookup on the incoming IP, and contstucts an
appropriate query for whichever table it looks in (sorry, no mySQL docs to
hand) to match either the IP or the hostname before deciding whether to
allow an operation.

Peter


----- Original Message -----
From: <ar...@india-today.com>
To: Tomcat <to...@jakarta.apache.org>
Sent: Tuesday, August 08, 2000 3:36 PM
Subject: Re: SQL Exception (same erro) (SOLVED)


> hi guys
> Managed to solve the problem but still I AM CONFUSED WITH WHATS
HAPPENING..
> After browsing thru some other mail archives it was suggested to have a
look at the strace output for a sample application..
>
> Though i didnt understand what strace generated i could make out was that
the connection was getting refused somehow or the other..
>
> This started off a long tedious recursive trials and one permutation
clicked for me..
>
> I used to mention the ip address of the machine, but the connect string
used to convert it into the DNS name and mysql refused such a connection as
there was no such entry in the access control tables.. Now what is confusing
me is that why should the connect string try to get the fully qualified name
when being supplied with the IP address..
>
> Will anyone will be kind enough to go thru the strace output generated and
give me the feedback..
>
> The attached strace file was generated when i tried to connect to the
database using the IP address but the connect string chose to query the name
server 64.14.239.201 for the fully qualified domain name on port 53..
>
> THANX A LOT FOR UR COOPERATION AND TIME..
> Bye
> Anand
> Today araman@india-today.com said
>
> > Please ignore if it has already been delivered..
> > Thanx
> > Anand
> >
> > ---------- Forwarded message ----------
> > Date: Tue, 8 Aug 2000 14:22:02 +0530 (IST)
> > From: araman@india-today.com
> > To: Tomcat <to...@jakarta.apache.org>
> > Subject: SQL Exception (same error)
> >
> > Hi again
> > After reading all ur mails i tried to the following
> >
> > 1. create a fresh user in the mysql database
> >
> > GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON subscriptions.* to
subs@localhost identified by 'some_pass';
> >
> > 2. create a sample application and test connectivity to the database
> >
> > import java.sql.*;
> >
> > public class trial {
> > Connection conn;
> > Statement stmt;
> >
> > public static void main(String args[]) {
> > trial tr = new trial();
> > String DBURL="jdbc:mysql:localhost///subscriptions";
> > try{
> > Class.forName("org.gjt.mm.mysql.Driver");
> > tr.conn=DriverManager.getConnection(DBURL,"subs","some_pass");
> > tr.stmt=tr.conn.createStatement();
> > System.out.println("In connect");
> > System.out.println(tr.stmt);
> > } catch(Exception ex){
> > System.out.println(ex.toString());
> > }
> > }
> > }
> >
> > 3. On compiling and excuting I still manage to get the following error
> >
> > java.sql.SQLException: Server configuration denies access to data source
> >
> > Why is this coming.. I have gone over the privileges table many times
and everything seems to be fine..  I am also able to connect to the database
using the mysql client and the same login and passwd..
> >
> > This thing is totally driving me up the wall if ay one of u could tell
me why it is happening so..
> >
> > Thanx for ur time
> > Anand Raman
> >
> >
> >
>
>


RE: SQL Exception (same erro) (SOLVED)

Posted by Mike Bremford <mi...@paperx.com>.
Hi araman

mysqld does a DNS lookup to see who's connecting.

Take a look at
http://www.mysql.com/documentation/mysql/full/manual_toc.html#Access_denied.
There are a couple of points about 10 bulletpoints down which give more
detail.

Cheers... Mike

-----Original Message-----
From: araman@india-today.com [mailto:araman@india-today.com]
Sent: 08 August 2000 15:37
To: Tomcat
Subject: Re: SQL Exception (same erro) (SOLVED)


hi guys
Managed to solve the problem but still I AM CONFUSED WITH WHATS HAPPENING..
After browsing thru some other mail archives it was suggested to have a look
at the strace output for a sample application..

Though i didnt understand what strace generated i could make out was that
the connection was getting refused somehow or the other..

This started off a long tedious recursive trials and one permutation clicked
for me..

I used to mention the ip address of the machine, but the connect string used
to convert it into the DNS name and mysql refused such a connection as there
was no such entry in the access control tables.. Now what is confusing me is
that why should the connect string try to get the fully qualified name when
being supplied with the IP address..

Will anyone will be kind enough to go thru the strace output generated and
give me the feedback..

The attached strace file was generated when i tried to connect to the
database using the IP address but the connect string chose to query the name
server 64.14.239.201 for the fully qualified domain name on port 53..

THANX A LOT FOR UR COOPERATION AND TIME..
Bye
Anand
Today araman@india-today.com said

> Please ignore if it has already been delivered..
> Thanx
> Anand
>
> ---------- Forwarded message ----------
> Date: Tue, 8 Aug 2000 14:22:02 +0530 (IST)
> From: araman@india-today.com
> To: Tomcat <to...@jakarta.apache.org>
> Subject: SQL Exception (same error)
>
> Hi again
> After reading all ur mails i tried to the following
>
> 1.	create a fresh user in the mysql database
>
> 	GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON subscriptions.* to
subs@localhost identified by 'some_pass';
>
> 2.	create a sample application and test connectivity to the database
>
> 	import java.sql.*;
>
> 	public class trial {
> 		Connection conn;
> 		Statement stmt;
>
> 		public static void main(String args[]) {
> 			trial tr = new trial();
> 			String DBURL="jdbc:mysql:localhost///subscriptions";
> 			try{
> 				Class.forName("org.gjt.mm.mysql.Driver");
> 				tr.conn=DriverManager.getConnection(DBURL,"subs","some_pass");
> 				tr.stmt=tr.conn.createStatement();
> 				System.out.println("In connect");
> 				System.out.println(tr.stmt);
> 			} catch(Exception ex){
> 				System.out.println(ex.toString());
> 			}
> 		}
> 	}
>
> 3.	On compiling and excuting I still manage to get the following error
>
> 	java.sql.SQLException: Server configuration denies access to data source
>
> Why is this coming.. I have gone over the privileges table many times and
everything seems to be fine..  I am also able to connect to the database
using the mysql client and the same login and passwd..
>
> This thing is totally driving me up the wall if ay one of u could tell me
why it is happening so..
>
> Thanx for ur time
> Anand Raman
>
>
>



Re: SQL Exception (same erro) (SOLVED)

Posted by ar...@india-today.com.
hi guys 
Managed to solve the problem but still I AM CONFUSED WITH WHATS HAPPENING..
After browsing thru some other mail archives it was suggested to have a look at the strace output for a sample application..

Though i didnt understand what strace generated i could make out was that the connection was getting refused somehow or the other..

This started off a long tedious recursive trials and one permutation clicked for me..

I used to mention the ip address of the machine, but the connect string used to convert it into the DNS name and mysql refused such a connection as there was no such entry in the access control tables.. Now what is confusing me is that why should the connect string try to get the fully qualified name when being supplied with the IP address..

Will anyone will be kind enough to go thru the strace output generated and give me the feedback..

The attached strace file was generated when i tried to connect to the database using the IP address but the connect string chose to query the name server 64.14.239.201 for the fully qualified domain name on port 53.. 

THANX A LOT FOR UR COOPERATION AND TIME..
Bye
Anand
Today araman@india-today.com said

> Please ignore if it has already been delivered..
> Thanx
> Anand
> 
> ---------- Forwarded message ----------
> Date: Tue, 8 Aug 2000 14:22:02 +0530 (IST)
> From: araman@india-today.com
> To: Tomcat <to...@jakarta.apache.org>
> Subject: SQL Exception (same error)
> 
> Hi again
> After reading all ur mails i tried to the following
> 
> 1.	create a fresh user in the mysql database
> 	
> 	GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP ON subscriptions.* to subs@localhost identified by 'some_pass';
> 
> 2.	create a sample application and test connectivity to the database
> 	
> 	import java.sql.*;
> 	
> 	public class trial {
> 		Connection conn;
> 		Statement stmt;
> 
> 		public static void main(String args[]) {
> 			trial tr = new trial();
> 			String DBURL="jdbc:mysql:localhost///subscriptions";
> 			try{
> 				Class.forName("org.gjt.mm.mysql.Driver");
> 				tr.conn=DriverManager.getConnection(DBURL,"subs","some_pass");
> 				tr.stmt=tr.conn.createStatement();
> 				System.out.println("In connect");
> 				System.out.println(tr.stmt);
> 			} catch(Exception ex){
> 				System.out.println(ex.toString());
> 			}
> 		}
> 	}
> 
> 3.	On compiling and excuting I still manage to get the following error
> 
> 	java.sql.SQLException: Server configuration denies access to data source
> 
> Why is this coming.. I have gone over the privileges table many times and everything seems to be fine..  I am also able to connect to the database using the mysql client and the same login and passwd..  
> 
> This thing is totally driving me up the wall if ay one of u could tell me why it is happening so..
> 
> Thanx for ur time
> Anand Raman
> 
> 
>