- 7.9.1.1 为调试编译 MySQL7.9.1.1 Compiling MySQL for Debugging
- 7.9.1.2 创建跟踪文件7.9.1.2 Creating Trace Files
- 7.9.1.3 使用 WER 和 PDB 创建 Windows 崩溃转储7.9.1.3 Using WER with PDB to create a Windows crashdump
- 7.9.1.4 在 gdb 下调试 mysqld7.9.1.4 Debugging mysqld under gdb
- 7.9.1.5 使用堆栈跟踪7.9.1.5 Using a Stack Trace
- 7.9.1.6 使用服务器日志查找 mysqld 错误原因7.9.1.6 Using Server Logs to Find Causes of Errors in mysqld
- 7.9.1.7 如果遇到表损坏,制作测试用例7.9.1.7 Making a Test Case If You Experience Table Corruption
如果你正在使用 MySQL 中非常新的某些功能,可以尝试使用 mysqld 并加上 --skip-new 选项(该选项会禁用所有新功能,可能不安全)。请参见 B.3.3.3 节,“如果 MySQL 不断崩溃该怎么办”。If you are using some functionality that is very new in MySQL, you
can try to run mysqld with the
--skip-new option (which disables
all new, potentially unsafe functionality). See
Section B.3.3.3, “What to Do If MySQL Keeps Crashing”.
如果 mysqld 无法启动,请确认没有任何 my.cnf 文件干扰您的设置!您可以使用 mysqld --print-defaults 检查 my.cnf 参数,并通过使用 mysqld --no-defaults ... 来避免使用它们。If mysqld does not want to start, verify that
you have no my.cnf files that interfere with
your setup! You can check your my.cnf
arguments with mysqld --print-defaults and
avoid using them by starting with mysqld --no-defaults
....
如果 mysqld 开始占用大量 CPU 或内存,或者如果它 “挂起,” 你可以使用 mysqladmin processlist status 来查出是否有人正在执行耗时的查询。如果你遇到性能问题或新客户端无法连接的问题,可能需要在某个窗口中运行 mysqladmin -i10 processlist status。If mysqld starts to eat up CPU or memory or if it “hangs,” you can use mysqladmin processlist status to find out if someone is executing a query that takes a long time. It may be a good idea to run mysqladmin -i10 processlist status in some window if you are experiencing performance problems or problems when new clients cannot connect.
命令 mysqladmin debug 会将一些关于正在使用的锁、使用的内存和查询使用情况的信息转储到 MySQL 日志文件中。这可能有助于解决一些问题。即使你没有为调试编译 MySQL,该命令也提供了一些有用的信息!The command mysqladmin debug dumps some information about locks in use, used memory and query usage to the MySQL log file. This may help solve some problems. This command also provides some useful information even if you have not compiled MySQL for debugging!
如果问题是某些表变得越来越慢,您应该尝试使用OPTIMIZE TABLE或myisamchk来优化表。请参阅第 7 章,MySQL 服务器管理。您还应该使用EXPLAIN检查慢查询。If the problem is that some tables are getting slower and slower
you should try to optimize the table with
OPTIMIZE TABLE or
myisamchk. See
Chapter 7, MySQL Server Administration. You should also check the
slow queries with EXPLAIN.
您还应阅读本手册中针对操作系统的特定章节,以了解可能仅在您的环境中出现的问题。参见 第 2.1 节,“通用安装指南”。You should also read the OS-specific section in this manual for problems that may be unique to your environment. See Section 2.1, “General Installation Guidance”.