Return-Path: Delivered-To: apmail-jakarta-tomcat-user-archive@apache.org Received: (qmail 61093 invoked from network); 25 May 2003 20:59:12 -0000 Received: from exchange.sun.com (192.18.33.10) by daedalus.apache.org with SMTP; 25 May 2003 20:59:12 -0000 Received: (qmail 15018 invoked by uid 97); 25 May 2003 21:01:26 -0000 Delivered-To: qmlist-jakarta-archive-tomcat-user@nagoya.betaversion.org Received: (qmail 15011 invoked from network); 25 May 2003 21:01:26 -0000 Received: from daedalus.apache.org (HELO apache.org) (208.185.179.12) by nagoya.betaversion.org with SMTP; 25 May 2003 21:01:26 -0000 Received: (qmail 59656 invoked by uid 500); 25 May 2003 20:58:59 -0000 Mailing-List: contact tomcat-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Tomcat Users List" Reply-To: "Tomcat Users List" Delivered-To: mailing list tomcat-user@jakarta.apache.org Received: (qmail 59645 invoked from network); 25 May 2003 20:58:59 -0000 Received: from hosting-132-150.phpwebhosting.com (HELO flow.phpwebhosting.com) (64.72.132.150) by daedalus.apache.org with SMTP; 25 May 2003 20:58:59 -0000 Received: (qmail 3415 invoked by uid 508); 25 May 2003 20:59:04 -0000 Received: from unknown (HELO 192.168.1.1) (203.59.151.58) by hosting-132-150.phpwebhosting.com with SMTP; 25 May 2003 20:59:04 -0000 From: Jason Bainbridge Organization: KDE Web Team To: "Tomcat Users List" Subject: Re: DB Connection Date: Mon, 26 May 2003 04:59:09 +0800 User-Agent: KMail/1.5.9 References: In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <200305260459.10084.jason@jblinux.org> X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N A straight copy and paste from the README of the MySQL JDBC driver, would seem the permissions have changed on the MySQL user you use to connect: Issue: "When I try to connect to the database with MySQL Connector/J, I get the following exception: SQLException: Server configuration denies access to data source SQLState: 08001 VendorError: 0 What's going on? I can connect with the MySQL client." Resolution: MySQL Connector/J must use TCP/IP sockets to connect to MySQL, as Java does not support Unix Domain Sockets. Therefore, when MySQL Connector/J connects to MySQL, the security manager in MySQL server will use the HOSTS table to determine whether or not the connection should be allowed. You must add grants to allow this to happen. The following is an example of how to do this (but not the most secure). From the mysql command-line client, issue the following command "GRANT ALL PRIVILEGES ON [dbname].* to '[user]'@'[hostname]' identified by '[password]'" replacing [dbname] with the name of your database, [user] with the username, [hostname] with the host that MySQL Connector/J will be connecting from, and [password] with the password you want to use. Be aware that RedHat linux is broken with respect to the hostname portion for the case when you are connecting from localhost. You need to use "localhost.localdomain" for the [hostname] value in this case. Follow this by issuing the "FLUSH PRIVILEGES" command. NOTE: Testing your connectivity with the "mysql" command-line client will not work unless you add the "--host" flag, and use something other than "localhost" for the host. The "mysql" command-line client will use Unix domain sockets if you use the special hostname "localhost". If you are testing connectivity to "localhost", use "127.0.0.1" as the hostname instead. I suggest you read the permissions/security section of your MySQL server manual for a much more detailed explanation of how this works. Regards, -- Jason Bainbridge KDE Web Team - http://kde.org webmaster@kde.org On Mon, 26 May 2003 04:06, Jan Behrens wrote: > hi list, > > i am not sure whether this is a tomcat related problem or something else... > > i am developing a webapp that simulates a banking system (for a school), > all data is stored in a mysql database (4.0.12). all worked fine for month > an now, all of a sudden i keep getting the follwoing error when connecting > to the database: > > java.sql.SQLException: Server configuration denies access to data source > > i then can no longer connect to the db. i do not use tomcats connection > pooling but instead connect via a special class. > any help on this would be very much appreciated! > > jan > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org > For additional commands, e-mail: tomcat-user-help@jakarta.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org For additional commands, e-mail: tomcat-user-help@jakarta.apache.org