Access denied
Error
MySQL server has gone away
Error
Can't connect to [local] MySQL server
Error
Client does not support authentication protocol
error
Host '...' is blocked
Error
Too many connections
Error
Some non-transactional changed tables couldn't be rolled back
Error
Out of memory
Error
Packet too large
Error
The table is full
Error
Can't create/write to file
Error
Commands out of sync
Error in Client
Ignoring user
Error
Table 'xxx' doesn't exist
Error
Can't initialize character set xxx
error
MySQL server has gone away
Error
This section also covers the related Lost connection to server
during query
error.
The most common reason for the MySQL server has gone away
error
is that the server timed out and closed the connection. By default, the
server closes the connection after 8 hours if nothing has happened. You
can change the time limit by setting the wait_timeout
variable when
you start mysqld
.
Another common reason to receive the MySQL server has gone away
error
is because you have issued a ``close'' on your MySQL connection
and then tried to run a query on the closed connection.
If you have a script, you just have to issue the query again for the client to do an automatic reconnection.
You normally can get the following error codes in this case (which one you get is OS-dependent):
Error code | Description |
CR_SERVER_GONE_ERROR | The client couldn't send a question to the server. |
CR_SERVER_LOST | The client didn't get an error when writing to the server, but it didn't get a full answer (or any answer) to the question. |
You will also get this error if someone has kills the running thread with
kill #threadid#
.
You can check that the MySQL hasn't died by executing mysqladmin
version
and examining the uptime. If the problem is that mysqld
crashed you should concentrate one finding the reason for the crash.
You should in this case start by checking if issuing the query again
will kill MySQL again. See section A.4.1 What To Do If MySQL Keeps Crashing.
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 too large
or out of order, it assumes that something has gone wrong with the client and
closes the connection. If you need big queries (for example, if you are
working with big BLOB
columns), you can increase the query limit by
starting mysqld
with the -O max_allowed_packet=#
option
(default 1M). The extra memory is allocated on demand, so mysqld
will
allocate more memory only when you issue a big query or when mysqld
must
return a big result row!
You will also get a lost connection if you are sending a packet >= 16M if your client is older than 4.0.8 and your server is 4.0.8 and above, or the other way around.
If you want to make a bug report regarding this problem, be sure that you include the following information:
hostname.err file
. See section A.4.1 What To Do If MySQL Keeps Crashing.
mysqld
and the involved tables where
checked with CHECK TABLE
before you did the query, can you do
a test case for this? See section E.1.6 Making a Test Case If You Experience Table Corruption.
wait_timeout
variable in the MySQL server ?
mysqladmin variables
gives you the value of this
mysqld
with --log
and check if the
issued query appears in the log ?
See section 1.7.1.2 Asking Questions or Reporting Bugs.
Posted by Geoff Kendal on Friday May 17 2002, @6:24am | [Delete] [Edit] |
If you keep getting:
error: 'Can't connect to local MySQL server
through socket '/tmp/mysql.sock' (2)'
Some RPM's put the mysql.sock file
in /var/lib/mysql/mysql.sock instead
of /tmp/mysql.sock
I was pulling my hair out for ages over this!
Small hack is to symlink it:
"ln -s /var/lib/mysql/mysql.sock /tmp"
Posted by [name withheld] on Friday May 17 2002, @6:24am | [Delete] [Edit] |
After a lot of investigation on how to manage
MySql server crashs i
set up a hourly cron script that will check if
mysql daemon is running
and if not will restart apache automaticaly.
This script is running in my server now and its
doing great.
# Begin Script
#!/bin/sh
#
# Stay alive crontab script:
#
if test -f "/var/lib/mysql/mysqld.pid"; then
echo "/var/lib/mysql/mysqld.pid" exist
else
echo "/var/lib/mysql/mysqld.pid" does not
exist
shutdown -r now > /dev/null
fi
exit 0
# End Script
Posted by [name withheld] on Friday May 17 2002, @6:24am | [Delete] [Edit] |
This is a quick minor correction to the previous
comment. The author talks about a script
that "restarts apache" - when he is actually
restarting MySql.
Posted by Gil Caseiro on Friday May 17 2002, @6:24am | [Delete] [Edit] |
Bei Puretec Datenbanken ist es notwendig in der Zeile $cfgServers[1]['port'] = '';
als Port 3306 einzugeben. Also: $cfgServers[1]['port'] = '3306';
Posted by Gary Shingles on Wednesday December 18 2002, @5:29pm | [Delete] [Edit] |
babelfish.altavista.com: With Puretec
data bases it is necessary in the line
$$cfgServers[1]['port ' ] = ' '; to enter as
haven 3306. Thus: $$cfgServers[1]['port ' ] =
' 3306';
Posted by Michael Bagley on Friday May 17 2002, @6:24am | [Delete] [Edit] |
I'm running Red Hat 7.2 and tried the symlink
approach to repairing this problem with no
success. I am curios as to what I beleive is the
German's sugestion, but I am unable to translate
the suggestion.
Posted by [name withheld] on Friday June 7 2002, @5:11pm | [Delete] [Edit] |
For those amongst us unfortunate enough to run
MySQL on windows 2000:
If you can't get the service to start, configure
your my.ini script to use innodb and set some
normal params as described in the manual
elsewhere.
Run "MySQLd --skip-name-resolve" from the command
prompt. When innodb has started you can login to
your database with root, even though the MySQL
service doesn't appear to be started. You can now
use your database as you see fit. Also, you don't
have to try to start the service once you've done
the above, because that won't work anyway.
This worked for me on Windows 2000 SBS (yes you
can laugh at me), but I'm not sure weither this
is the solution for everyone...
Depsua666@hotmail.com
Posted by rodrigo reyes on Thursday September 26 2002, @3:55pm | [Delete] [Edit] |
I have a problem with a Perl Script that keeps
sending me the nex error "DBD::mysql::st execute
failed: MySQL server has gone away at path to
archive " but the script sometimes works and others
no I hope someone can help me with this problem
Posted by Rodney Peck on Saturday October 5 2002, @1:58pm | [Delete] [Edit] |
Here's something that others might run across
which I haven't
seen mentioned on this site elsewhere.
I was suddenly getting server restarts and 'server
has gone
away' errors from one of the hosts that processes
data on
my mysqld database. There were two other hosts which
were running just fine. Rebuilding the indices
with myisamchk
took a long time, but didn't fix the problem.
The problem turned out to be caused by a lack of
reverse
name lookups in DNS for the ip of the clients.
Somehow
the dns server listed in /etc/resolv.conf had
stopped doing
reverse lookup resolution for the zone these
clients were in.
Some of the hosts were listed in /etc/hosts --
those were
the ones that were working.
Simply adding the hostnames to /etc/hosts with the
correct
ip addresses was enough to get mysqld and the
client working
normally again.
The dns server has since been fixed as well to manage
the reverse zone for the client network as expected by
mysqld.
This is interesting because the error has nothing
to do
with a network timeout as was described in the other
messages.
I dont know if it would have helped, but there was
nothing
logged in the error log for mysqld saying that it
failed
because of the ip address lookup.
Posted by Leonardo Papa on Monday April 28 2003, @2:20am | [Delete] [Edit] |
I tried to run "mysqldump -A" for backup purposes (mysqldump -A -p > backup.sql).After that I got the "Lost Connection to MySQL server during query" error. I search in many mailing list about this error and find that I need to downgrade a glibc of my red hat Linux. I do that but MySQL return the same error. So I tried to run "mysqldump -A" with "nice -20" (highest priority) to see if the problem is some kind of timeout in mysqldump connection and I get no error. The complete command was "nice --20 mysqldump -A -p > backup.sql".
Posted by Mac Chin on Wednesday March 26 2003, @11:00pm | [Delete] [Edit] |
MySQL server has gone away error may also due to mis configed network setting .
Try add skip-name-resolve under [mysqld] in my.cnf
Posted by hooi Yap on Wednesday June 25 2003, @1:41am | [Delete] [Edit] |
The way I have resolved the 'Error message = Lost connection to MySQL server during query' is to edit /etc/hosts.allow and then add an additional line as shown below to the file:
mysqld:127.0.0.1