Re: Mysql does not answer to Java anymore!!!
From: David Harper (devnull_at_obliquity.u-net.com)
Date: 06/01/04
- Next message: Michal: "dbf with index"
- Previous message: Jacek Sałacki: "Re: Mysql does not answer to Java anymore!!!"
- In reply to: Robert Kocher: "Re: Mysql does not answer to Java anymore!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 01 Jun 2004 08:46:18 +0100
Robert Kocher wrote:
[SNIP]
> What i found out by myself now, is that it only fails, if i try to
> connect as 'localhost' or by other words, when the socket file is
> used. If i connect as host, let's say with '127.0.0.1:3306' it works.
> The strange thing is, that the socket works with mysqladmin and this
> kind of tools, but not with the java connector. In my eyes, this
> tells me, that the socket is not broken...
The JDBC driver can only connect via the TCP/IP socket. Java has no
knowledge of Unix-style sockets. You need to ensure that your MySQL
server is listening on a TCP/IP socket *and* that you have set the
appropriate privileges (using the GRANT command) to allow client
programs to connect via TCP/IP.
Bear in mind that the mysql command line client will always try to use
Unix-style sockets if you specify the hostname as "localhost", and that
there are circumstances when MySQL may make a distinction between
"localhost" and "127.0.0.1" when it applies the access rules in its
grant tables.
David Harper
Cambridge, England
- Next message: Michal: "dbf with index"
- Previous message: Jacek Sałacki: "Re: Mysql does not answer to Java anymore!!!"
- In reply to: Robert Kocher: "Re: Mysql does not answer to Java anymore!!!"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|
|