Date: Mon, 12 May 2003 07:17:11 -0700 (PDT) From: Tom Samplonius <tom@sdf.com> To: Anselme <anselme@netcourrier.com> Cc: freebsd-database <freebsd-database@freebsd.org> Subject: Re: MySQL & jdbc Message-ID: <Pine.BSF.4.05.10305120714480.2996-100000@misery.sdf.com> In-Reply-To: <1052736418.280.23.camel@Toto.dippgw.homedns.org>
next in thread | previous in thread | raw e-mail | index | archive | help
When running mysql on the console, it will connect via a named pipe.
The JDBC driver does not support named pipes, and must open a TCP/IP
socket to localhost.
A common problem is that the MySQL permission tables say "localhost",
but 127.0.0.1 reverse resolves to "localhost.mydomain.com".
Tom
On 12 May 2003, 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
>
> --
> Anselme <anselme@netcourrier.com>
>
> _______________________________________________
> freebsd-database@freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-database
> To unsubscribe, send any mail to "freebsd-database-unsubscribe@freebsd.org"
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.4.05.10305120714480.2996-100000>
