PDA

View Full Version : MySQL Lost Connection


Moonlight
10-06-1999, 08:45 AM
It has been a while I did not have any problems with MySQL Lost Connection but since a few days, it's so often.

For example, 2 days ago I had a log of cgi errors of 30k only of MySQL Lost Connection, that is in 1 day.

This morning, in the last 20 minutes, it happened to me 8 times.

%% [Wed Oct[nbsp][nbsp]6 08:23:57 1999]
%% [Wed Oct[nbsp][nbsp]6 08:35:43 1999]
%% [Wed Oct[nbsp][nbsp]6 08:35:51 1999]
%% [Wed Oct[nbsp][nbsp]6 08:35:53 1999]
%% [Wed Oct[nbsp][nbsp]6 08:35:54 1999]
%% [Wed Oct[nbsp][nbsp]6 08:35:56 1999]
%% [Wed Oct[nbsp][nbsp]6 08:35:57 1999]
%% [Wed Oct[nbsp][nbsp]6 08:43:26 1999]

In fact, it been more than 20 minutes I could not connect to the MySQL server.

I even tried via TELNET, and when I wrote MySQL I got :
"ERROR 2013: Lost connection to MySQL server during query"

A while back there was a talk about a dedicdated server for MySQL, is there any news?

Can someone give me a routine that would replace the following code with a 'retry' rountine :
sub db_connect{

[nbsp][nbsp]if (!$ENV{'MOD_PERL'}) {
[nbsp][nbsp][nbsp][nbsp]require DBI;
[nbsp][nbsp]}

[nbsp][nbsp]$dbh = DBI -> connect("DBI:$config{'dbdriver'}:$config{'dbname'}:$config{'dbser ver'}", "$config{'dbuser'}", "$config{'dbpass'}")
[nbsp][nbsp]or die "Can't connect to sql server.[nbsp][nbsp]Reason: $DBI::errstr";

[nbsp][nbsp]if (!$ENV{'MOD_PERL'}) {
[nbsp][nbsp][nbsp][nbsp]$dbh->{'Warn'} = 0;
[nbsp][nbsp]}

}And please, don't give me a pseudo-code but a direct coding that I could use.

Thanks...

Moonlight

Dean B
10-06-1999, 10:49 AM
A couple of my cron jobs recently have also returned an 'MySQL lost connection' error ...

------------------
Regards, Dean.
**DMCity**
www.dmcity.com (http://www.dmcity.com)[nbsp][nbsp][nbsp][nbsp][nbsp][nbsp]
**********

Deb
10-06-1999, 11:05 AM
Closing this thread as it was addressed here http://www.aota.net/ubb/Forum4/HTML/000267.html

I would like to ask that you use the MySQL/PHP forum for your coding questions and the Server Questions/Suggestions forums for questions relating to the servers.[nbsp][nbsp]This will help us to keep the Server News forum specifically for News ...[nbsp][nbsp]thanks.

Deb