Administration-Related Issues
2962
Each MySQL version is tested on many platforms before it is released. This does not mean that there
are no bugs in MySQL, but if there are bugs, they should be very few and can be hard to find. If you
have a problem, it always helps if you try to find out exactly what crashes your system, because you
have a much better chance of getting the problem fixed quickly.
First, you should try to find out whether the problem is that the
mysqld
server dies or whether your
problem has to do with your client. You can check how long your
mysqld
server has been up by
executing
mysqladmin version
. If
mysqld
has died and restarted, you may find the reason by
looking in the server's error log. See
Section 5.2.1, “The Error Log”
.
On some systems, you can find in the error log a stack trace of where
mysqld
died that you can
resolve with the
resolve_stack_dump
program. See
MySQL Internals: Porting to Other Systems
.
Note that the variable values written in the error log may not always be 100% correct.
Many server crashes are caused by corrupted data files or index files. MySQL updates the files on disk
with the
write()
system call after every SQL statement and before the client is notified about the
result. (This is not true if you are running with
--delay-key-write
[406]
, in which case data files
are written but not index files.) This means that data file contents are safe even if
mysqld
crashes,
because the operating system ensures that the unflushed data is written to disk. You can force MySQL
to flush everything to disk after every SQL statement by starting
mysqld
with the
--flush
[408]
option.
The preceding means that normally you should not get corrupted tables unless one of the following
happens:
• The MySQL server or the server host was killed in the middle of an update.
• You have found a bug in
mysqld
that caused it to die in the middle of an update.
• Some external program is manipulating data files or index files at the same time as
mysqld
without
locking the table properly.
• You are running many
mysqld
servers using the same data directory on a system that does not
support good file system locks (normally handled by the
lockd
lock manager), or you are running
multiple servers with external locking disabled.
• You have a crashed data file or index file that contains very corrupt data that confused
mysqld
.
• You have found a bug in the data storage code. This isn't likely, but it is at least possible. In this
case, you can try to change the storage engine to another engine by using
ALTER TABLE
on a
repaired copy of the table.
Because it is very difficult to know why something is crashing, first try to check whether things that work
for others crash for you. Please try the following things:
• Stop the
mysqld
server with
mysqladmin shutdown
, run
myisamchk --silent --force */
*.MYI
from the data directory to check all
MyISAM
tables, and restart
mysqld
. This ensures that you
are running from a clean state. See
Chapter 5, MySQL Server Administration
.
• Start
mysqld
with the general query log enabled (see
Section 5.2.2, “The General Query Log”
).
Then try to determine from the information written to the log whether some specific query kills the
server. About 95% of all bugs are related to a particular query. Normally, this is one of the last
queries in the log file just before the server restarts. See
Section 5.2.2, “The General Query Log”
.
If you can repeatedly kill MySQL with a specific query, even when you have checked all tables just
before issuing it, then you have been able to locate the bug and should submit a bug report for it.
See
Section 1.7, “How to Report Bugs or Problems”
.
• Try to make a test case that we can use to repeat the problem. See
MySQL Internals: Porting to
Other Systems
.
• Try running the tests in the
mysql-test
directory and the MySQL benchmarks. See
Section 21.1.2,
“The MySQL Test Suite”
. They should test MySQL rather well. You can also add code to the
Содержание 5.0
Страница 1: ...MySQL 5 0 Reference Manual ...
Страница 18: ...xviii ...
Страница 60: ...40 ...
Страница 396: ...376 ...
Страница 578: ...558 ...
Страница 636: ...616 ...
Страница 844: ...824 ...
Страница 1234: ...1214 ...
Страница 1426: ...MySQL Proxy Scripting 1406 The following diagram shows an overview of the classes exposed by MySQL Proxy ...
Страница 1427: ...MySQL Proxy Scripting 1407 ...
Страница 1734: ...1714 ...
Страница 1752: ...1732 ...
Страница 1783: ...Configuring Connector ODBC 1763 ...
Страница 1793: ...Connector ODBC Examples 1773 ...
Страница 1839: ...Connector Net Installation 1819 2 You must choose the type of installation to perform ...
Страница 1842: ...Connector Net Installation 1822 5 Once the installation has been completed click Finish to exit the installer ...
Страница 1864: ...Connector Net Visual Studio Integration 1844 Figure 20 24 Debug Stepping Figure 20 25 Function Stepping 1 of 2 ...
Страница 2850: ...2830 ...
Страница 2854: ...2834 ...
Страница 2928: ...2908 ...
Страница 3000: ...2980 ...
Страница 3122: ...3102 ...
Страница 3126: ...3106 ...
Страница 3174: ...3154 ...
Страница 3232: ...3212 ...