Mysql odesel - co to znamena?

Zdeněk Böhm zdenek.bohm na gammarus.cz
Čtvrtek Leden 24 10:29:39 CET 2002


> > mam mozna primitivni dotaz, ale v jedne php, nad MySQL bezici, aplikaci
se
> > mi obcas vyskytne chyba cislo 2006 s timto popisem chyby: "MySQL server
has
> > gone away". V mysqld_errors chyba s timto cislem neni vubec popsana a
vubec
> > se to tvari zvlastne, protoze, kdyz se vyskytne a dam reload stranky,
tak uz
> > to bezi korektne.

> A vskutku - na adrese
>
> http://www.mysql.com/doc/G/o/Gone_away.html
>
> je k precteni snad dostatecne vycerpavajici popis Vaseho problemu.

Obavam se, ze z toho porad nevim, kde je chyba,

MAN: The most common reason for the MySQL server has gone away error is that
the server timed out and closed the connection. MAN: By default, the server
closes the connection after 8 hours if nothing has happened. You can change
the time limit by setting MAN: the wait_timeout variable when you start
mysqld.

Rozhodne nehrozi, ze by se vyskytlo 8 hodin necinnosti, spis se obavam, ze
ten server krmim az prilis.

MAN: Another common reason to receive the MySQL server has gone away error
is because you have issued a ``close'' on your MAN: MySQL connection and
then tried to run a query on the closed connection.

Tohle to taky neni, v zadnem skriptu nepouzivam close - vyuzivam toho, ze
php ukonci spojeni automaticky po ukonceni scriptu.

MAN: You can check that the MySQL hasn't died by executing mysqladmin
version and examining the uptime.

Tohle to taky neni, ta aplikace posila dotazy celkem huste, najednou se
vyskytne chyba, po reloady stranky uz to jede. I kdyby mysql spadl, tak
nestihne restartovat tak rychle, aby po reloadu stranky uz byl ready a
vyridil ten samy dotaz korektne.

MAN: You can also get these errors if you send a query to the server that is
incorrect or too large. If mysqld gets a packet that is MAN: too large or
out of order, it assumes that something has gone wrong with the client and
closes the connection. If you need big MAN: queries (for example, if you are
working with big BLOB columns), you can increase the query limit by starting
mysqld with the MAN: -O max_allowed_packet=# option (default 1M). The extra
memory is allocated on demand, so mysqld will use more memory MAN: only when
you issue a big query or when mysqld must return a big result row!

Tak tohle to taky neni, ten dotaz, kdy se mi to prihodilo byl uplne
kratoucky select a urcite ne chybny, protoze jindy normalne funguje.

> BTW osobne jiz delsi dobu pri reseni problemu uspesne pouzivam
> Google, manualy a konference v uvedenem poradi. Velmi to setri cas
> (nejen muj :) - vrele doporucuji.

Ok, priste pouziju stejny postup, diky.

S pozdravem Zdenek Bohm




Další informace o konferenci Databases