MySQL java.net.SocketException: Broken pipe - Fixed!

Hmmmm... During deployment time to our Linux server, I encountered this error that said


MySQL java.net.SocketException: Broken pipe

It was really becoming frustrating since I couldn't determine where the error was coming. Checked the code, eliminated those finally blocks where I close the connection. It didn't solve the problem. Finally, when I was about to give up(or am I being real here?), I found this solution.

in mysql terminal:

mysql> SHOW VARIABLES;

Look a variable called connect_timeout, then set it to a higher value than you had before. Mine was from 10 to 60

mysql>SET GLOBAL connect_timeout=60;


voila! The error is gone!


Reference sites:

http://dev.mysql.com/doc/refman/4.1/en/server-system-variables.html
http://archives.neohapsis.com/archives/mysql/2006-q1/1047.html
http://forums.mysql.com/read.php?39,42763,96476#msg-96476
Published Monday, July 31, 2006 1:30 AM by lamia
Filed under: ,

Comments

# re: MySQL java.net.SocketException: Broken pipe - Fixed!

Tuesday, August 01, 2006 12:03 AM by bonskijr
hi lamia,

be careful of increasing connection timeout in any db server w/o checking out everything that you can think of(network connection,server availabilty etal) it might turn out that it isn't from your application itself and you'd have to let the user wait that much time to connect to your server. personally i think the default 10/15 sec is ok, if it takes that amount of time( > 60 sec) then it's likely that you have a connection problem or the above mentioned.

:)

# re: MySQL java.net.SocketException: Broken pipe - Fixed!

Tuesday, August 01, 2006 12:22 AM by lamia
I found out this to be an OS problem a few moments ago actually. After doing that, it only gave me a slight comfort with my application but after a few tries, there it was again. I'm about to do something in hour Red Hat Linux server which is right here:

http://issues.apache.org/bugzilla/show_bug.cgi?id=29907#c7

I don't know how it would help me but thanks for the caution.

# re: MySQL java.net.SocketException: Broken pipe - Fixed!

Sunday, August 24, 2008 10:59 PM by ламинат

3sThank's.0t I compleatly agree with last post.  dai

<a href="http://skuper.ru">ламинат купить</a> 5n

Leave a Comment

(required) 
(required) 
(optional)
(required) 

Enter the numbers above: