From owner-freebsd-java@FreeBSD.ORG Tue Jul 13 03:08:52 2004 Return-Path: Delivered-To: freebsd-java@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BB2FC16A4CE for ; Tue, 13 Jul 2004 03:08:52 +0000 (GMT) Received: from mta09-svc.ntlworld.com (mta09-svc.ntlworld.com [62.253.162.49]) by mx1.FreeBSD.org (Postfix) with ESMTP id C6D5143D5C for ; Tue, 13 Jul 2004 03:08:51 +0000 (GMT) (envelope-from antony.t.curtis@ntlworld.com) Received: from [10.10.10.100] ([81.107.87.144]) by mta09-svc.ntlworld.com (InterMail vM.4.01.03.37 201-229-121-137-20020806) with ESMTP id <20040713023950.EILP8050.mta09-svc.ntlworld.com@[10.10.10.100]>; Tue, 13 Jul 2004 03:39:50 +0100 From: Antony T Curtis To: Mohammad Reza In-Reply-To: References: Content-Type: text/plain Message-Id: <1089686344.922.8.camel@pcgem.rdg.cyberkinetica.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4 Date: Tue, 13 Jul 2004 03:39:04 +0100 Content-Transfer-Encoding: 7bit cc: java@freebsd.org Subject: Re: Could'nt connect to mysql X-BeenThere: freebsd-java@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Porting Java to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 13 Jul 2004 03:08:52 -0000 On Mon, 2004-07-12 at 09:53, Mohammad Reza wrote: > Dear List; > > I have problem to connect to mySQL database via my jsp script. > Here is the error ; > > javax.servlet.ServletException: Data source rejected establishment of > connection, message from server: "Host 'localhost.mra.co.id' is not > allowed to connect to this MySQL server" > > please help me > > regards > reza This is a privileges issue with the MySQL server. You should read up on the GRANT and REVOKE syntax - the documentation is available online at http://www.mysql.com/doc/ So you would issue to MySQL the command: GRANT SELECT ON mydb.* TO "username@localhost.mra.co.id" IDENTIFIED BY PASSWORD "mysecret"; Perhaps using the MySQL command line tool. http://dev.mysql.com/doc/mysql/en/GRANT.html -- Antony T Curtis