LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 10-13-2009, 05:45 AM   #1
cheires
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Rep: Reputation: 0
MySql Communications link failure


Hi everybody,
A few months ago i build a program that connects to a MySql database. The program worked fine.

Then i had to format my laptop. I installed the new slackware 13, and ever since that program that connects to a MySql Database dose't work anymore.
There's the error stack trace:
Code:
SQLException: State:   08S01Severity: 0
Communications link failure

The last packet successfully received from the server was 1,255,354,460,681 milliseconds ago.  The last packet sent successfully to the server was 0 milliseconds ago.
Exception in thread "main" java.lang.NullPointerException
I'm desperate to solve this.
I put the mysql connect in the class path, and one other several places.
I try both Eclipse and NetBeans, with the same result.
When i try to create a connection pool in Glassfish, dosen't ping.

Does anyone knows how to solve this problem?
Thank you all in advance
 
Old 10-14-2009, 02:54 PM   #2
wfh
Member
 
Registered: Sep 2009
Location: Northern California
Distribution: Ubuntu Debian CentOS RHEL Suse
Posts: 164

Rep: Reputation: 44
Have you "grant"ed permissions for the user connecting from the foreign host (the non-MySQL host)? Tell a bit more about the context in which the error is thrown. What was happening, did it work for a while and then stop?
 
Old 10-15-2009, 07:01 AM   #3
cheires
LQ Newbie
 
Registered: Aug 2009
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wfh View Post
Have you "grant"ed permissions for the user connecting from the foreign host (the non-MySQL host)? Tell a bit more about the context in which the error is thrown. What was happening, did it work for a while and then stop?
The user that i use to connect to MySql has all the grant permissions.
In the program, a Java Program, i use the same user. The access to MySql server is an local access.
The program worked fine before i format my laptop, now it dosen't work, with the newly installed OS (Slackware 13).
The error is trown as soon as i run the program.
 
Old 10-17-2009, 08:59 AM   #4
jlinkels
Senior Member
 
Registered: Oct 2003
Location: Bonaire
Distribution: Debian Wheezy/Jessie/Sid, Linux Mint DE
Posts: 4,234

Rep: Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545Reputation: 545
Java puts additional layer between you and the database connection. Try:
Code:
mysql -host yourhost -uyourname -pyourpwd yourdatabase
and see what happens.

Right now it is fully unclear where the error occurs, in the communications link or in the MySQL authentication.

Check your /etc/mysql/my.cnf
Code:
<cut>
language        = /usr/share/mysql/english
#skip-external-locking <<< must be commented
#
# Instead of skip-networking the default is now to listen only on
# localhost which is more compatible and is not less secure.
bind-address            = 192.168.0.18 <<< must be the IP of the host running mysql
<cut>
jlinkels
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Tomcat: Communication link failure: EOFException Vince-0 Linux - Server 0 03-11-2008 05:38 AM
Java JDBC-Exception: Communications link failure Swift&Smart Programming 1 12-06-2007 12:12 AM
Link failure at Suse 2.6.5 kernel mitubd Linux - Kernel 0 05-09-2007 01:00 AM
libmysqlclient.so.10 failure upgrading to mysql 4 raj000 Linux - Software 4 01-07-2006 06:29 AM
Frequent Ethernet Link Failure gjagadish Linux - Networking 10 10-22-2005 01:54 AM


All times are GMT -5. The time now is 05:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration