From owner-freebsd-database@FreeBSD.ORG Mon May 12 04:03:31 2003 Return-Path: Delivered-To: freebsd-database@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 7BA7B37B401 for ; Mon, 12 May 2003 04:03:31 -0700 (PDT) Received: from mail.die.supsi.ch (mail.die.supsi.ch [193.5.153.13]) by mx1.FreeBSD.org (Postfix) with ESMTP id C08D243FF2 for ; Mon, 12 May 2003 04:03:25 -0700 (PDT) (envelope-from nunnari@die.supsi.ch) Received: from die.supsi.ch (pcm2022.die.supsi.ch [193.5.152.22]) by mail.die.supsi.ch (8.11.6/8.11.6) with ESMTP id h4CB3FY13263; Mon, 12 May 2003 13:03:15 +0200 Message-ID: <3EBF7F73.1090502@die.supsi.ch> Date: Mon, 12 May 2003 13:03:15 +0200 From: Roberto Nunnari User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.1) Gecko/20020823 Netscape/7.0 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Anselme References: <1052736418.280.23.camel@Toto.dippgw.homedns.org> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit cc: freebsd-database Subject: Re: MySQL & jdbc X-BeenThere: freebsd-database@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Database use and development under FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 May 2003 11:03:31 -0000 if this doesn't work: # mysql -u username -p yourdbname then check your mysql user table: > use mysql; > select host, user, password from user; you should have an entry for username@localhost with password Anyways, in my java code I use: getConnection( "jdbc:mysql://localhost/mydbname", "myusername", "mypassword" ); regards. Anselme wrote: > Hi everybody ! > > I've got a little problem trying to get access to MySQL with a java > application. > > I use : > mysql 3.23.55 > linux-sun-jdk1.3.1.07_1 > mysql-jdbc-mm > FreeBSD 4.7-STABLE > > I got the connection with MySQL vi jdbc without problem but i can't > access the database as the user ... > I got the following from the server : > > #java.sql.SQLException: Invalid authorization specification: Access > denied for user: 'user_name@localhost.mydomain.com' (Using password: > YES) > > > The rights in MySQL sounds good because when I try to access by the > console, it's all fine. > > In the java program, I have the following code : > dbcxn = > DriverManager.getConnection("jdbc:mysql://localhost:3306/db_name?user=user_name&password=user_pwd") > > I also tryed with : > dbcxn = > DriverManager.getConnection("jdbc:mysql://localhost:3306/db_name","user_name","user_pwd"); > > Any Ideas ? > > Thanks > -- Roberto Nunnari -software engineer- mailto:nunnari@die.supsi.ch Scuola Universitaria Professionale della Svizzera Italiana Dipartimento di Informatica e Elettronica http://www.die.supsi.ch SUPSI-DIE Via Cantonale tel: +41-91-6108561 6928 Manno """ fax: +41-91-6108570 Switzerland (o o) =======================oOO==(_)==OOo========================