Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Databases / June 2004

Tip: Looking for answers? Try searching our database.

Mysql does not answer to Java anymore!!!

Thread view: 
Robert Kocher - 31 May 2004 07:39 GMT
Chris Smith wrote:

> Robert Kocher wrote:
>> I use Suse Linux, and there i run a mysql database. I have updated my
>> system to SuSE 9.1 and since then the connection over jdbc seems not to
>> work anymore. My own java programs throw a 'connection refused' and even
>> the jboss i'm running too with mysql says the same thing. I can normally
>> access mysql over console and from remote.
>>
>> Is there anybody knowing, what the problem could be???
>
> Apparently, MySQL is not starting.  You might look in your logs for any
> indication of a potential problem.

No, as i said, i can normally acces mysql from remote and from the console,
typing "mysql -u xxxx -p".
It is only the acces through the jdbc connector wich seems to fail!
anders - 31 May 2004 09:14 GMT
> Chris Smith wrote:
>
[quoted text clipped - 13 lines]
> typing "mysql -u xxxx -p".
> It is only the acces through the jdbc connector wich seems to fail!

I had similair problems with debian.

Some tips that helped me:
- add a line with the text 'skip-grant-tables' to my.cnf if it's not
already there

- look for a line that conatins the word 'skip-networking' in my.cnf and
uncomment it (i.e. set a # in front of it)

- your url should look similair to
JDBC:MYSQL://localhost:3306/test?username=<user>,password=<password>

you might want to take a look at:
http://dev.mysql.com/doc/mysql/en/Access_denied.html
Rhino - 31 May 2004 14:33 GMT
> Chris Smith wrote:
>
[quoted text clipped - 13 lines]
> typing "mysql -u xxxx -p".
> It is only the acces through the jdbc connector wich seems to fail!

Perhaps the JDBC connector has an incompatibility with SuSE 9.1; have you
tried getting a newer version of the JDBC connector? If that doesn't help,
perhaps you should post to the MySQL mailing list and see if others have had
the same problem. The URL to subscribe is: http://lists.mysql.com/. You
probably want the "MySQL and Java" mailing list.

Rhino
Robert Kocher - 31 May 2004 20:03 GMT
>> 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
Chris Smith - 31 May 2004 15:30 GMT
> No, as i said, i can normally acces mysql from remote and from the console,
> typing "mysql -u xxxx -p".
> It is only the acces through the jdbc connector wich seems to fail!

Okay, the MySQL documentation for Connector/J lists a few options here.  
They include:

1. You're writing an applet and don't have permission to connect.
2. You configured your server without TCP/IP support
3. There's a firewall in the way.

Seems to me that #2 is the more likely.  You might want to see if an
option called "--skip-networking" is being used when starting the
server.

Signature

www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.

Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.