LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 03-20-2003, 02:54 PM   #1
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,533

Rep: Reputation: 132Reputation: 132
mysql has gone away


hi,
i'm writing a perl script that gets some emails out of a pop3server and enters it in a mysql. works fine if the mailbox contains only a couple of mails. but if i have to insert about 42 or more the mysql server cuts the connection.
but i dont think it's a perl question.
has anybody an idea how comes? i checked my.cnf and mysql-man but still no clue.
thanks a lot,
jens
 
Old 03-26-2003, 08:20 AM   #2
EvilTwinSkippy
Member
 
Registered: Mar 2003
Location: Philadelphia, PA
Distribution: RedHat, Gentoo
Posts: 51

Rep: Reputation: 15
How are you doing it?

Perl lets you get into some bad habits with SQL connections.

Are you opening a new mysql connection for each statement, and then not closing them?

I use MySQL under TCL, and when I was starting out I used to have that problem. My trick is to open one connection, and the set a watchdog process to kill the connection after 5 minutes of inactivity, otherwise MySQL will kill it at some random interval, and depending on how smart your mysql client library is it may or may not screw up your program.

This watchdog maintains a flag that states whether the connection is live or not. My sqlstmt command checks the status of the flag and re-establishes the mysql link as needed.
 
Old 03-26-2003, 08:47 AM   #3
j-ray
Senior Member
 
Registered: Jan 2002
Location: germany
Distribution: ubuntu
Posts: 1,533

Original Poster
Rep: Reputation: 132Reputation: 132
thanks for your reply!
actually it was not a mysql problem but a mistake in the perl script. this made the value of a variable 'grow' in a loop until it became too big to fit into a mediumblob. (i initialized the variable at the wrong level.) interesting: it did give me no sort of sql-error msg.

but solved anyway!
cheers, jens
 
  


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
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. NoviceW Linux - Networking 17 09-17-2014 03:13 PM
Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock welery Linux - Software 19 03-06-2014 08:19 AM
ERROR 2002: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. suziecorbett Linux - Software 8 10-09-2008 02:52 AM
Problems with MySQL on SuSE: Can't Connect (/var/lib/mysql/mysql.sock) neocookie Linux - Software 8 02-08-2008 12:48 AM
mysql error Can't connect to local MySQL server through socket '/var/lib/mysql/mysql. Dannux Linux - Software 3 03-24-2006 09:44 AM


All times are GMT -5. The time now is 11:45 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration