LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (http://www.linuxquestions.org/questions/programming-9/)
-   -   MySql Communications link failure (http://www.linuxquestions.org/questions/programming-9/mysql-communications-link-failure-761554/)

cheires 10-13-2009 04:45 AM

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

wfh 10-14-2009 01:54 PM

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?

cheires 10-15-2009 06:01 AM

Quote:

Originally Posted by wfh (Post 3719258)
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.

jlinkels 10-17-2009 07:59 AM

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


All times are GMT -5. The time now is 04:54 AM.