>> Chris Smith wrote:
>>
[quoted text clipped - 24 lines]
>
> Rhino
Yep, i have tried this one too. I have also reinstalled mysql, but nothing
changed!
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...
Any suggestions??
Jacek Sałacki - 31 May 2004 23:02 GMT
> 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
[quoted text clipped - 4 lines]
>
> Any suggestions??
Mayby, when I upgraded your system, socket file has changed its location?
David Harper - 01 Jun 2004 08:46 GMT
[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