5.9.1 Debugging a MySQL Server调试MySQL服务器

5.9.1.1 Compiling MySQL for Debugging编译MySQL进行调试
5.9.1.2 Creating Trace Files创建跟踪文件
5.9.1.3 Using WER with PDB to create a Windows crashdump使用WER和PDB创建Windows崩溃转储
5.9.1.4 Debugging mysqld under gdb在gdb下调试mysqld
5.9.1.5 Using a Stack Trace使用堆栈跟踪
5.9.1.6 Using Server Logs to Find Causes of Errors in mysqld使用服务器日志查找mysqld中错误的原因
5.9.1.7 Making a Test Case If You Experience Table Corruption如果您遇到表格损坏,请制作测试用例

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). 如果你正在使用MySQL中一些非常新的功能,你可以尝试使用--skip-new选项运行mysqld(该选项禁用所有新的、可能不安全的功能)。See Section B.3.3.3, “What to Do If MySQL Keeps Crashing”.请参阅第B.3.3.3节,“如果MySQL持续崩溃该怎么办”

If mysqld does not want to start, verify that you have no my.cnf files that interfere with your setup! 如果mysqld不想启动,请验证您没有干扰设置的my.cnf文件!You can check your my.cnf arguments with mysqld --print-defaults and avoid using them by starting with mysqld --no-defaults ....您可以使用mysqld --print-defaults检查my.cnf参数,并从mysqld --print-defaults开始避免使用它们。

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. 如果mysqld开始消耗CPU或内存,或者它“挂起”,您可以使用mysqladmin processlist status来查看是否有人正在执行需要很长时间的查询。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 -i10 processlist status可能是个好主意。

The command mysqladmin debug dumps some information about locks in use, used memory and query usage to the MySQL log file. mysqladmin debug命令将有关正在使用的锁、已用内存和查询使用情况的一些信息转储到MySQL日志文件中。This may help solve some problems. This command also provides some useful information even if you have not compiled MySQL for debugging!这可能有助于解决一些问题。即使您没有编译MySQL进行调试,此命令也提供了一些有用的信息!

If the problem is that some tables are getting slower and slower you should try to optimize the table with OPTIMIZE TABLE or myisamchk. 如果问题是某些表变得越来越慢,您应该尝试使用OPTIMIZE TABLEmyisamchk优化表。See Chapter 5, MySQL Server Administration. You should also check the slow queries with EXPLAIN.请参阅第5章,“MySQL服务器管理”。您还应该使用EXPLAIN检查慢速查询。

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”.您还应该阅读本手册中特定于操作系统的部分,了解您的环境可能特有的问题。请参阅第2.1节,“一般安装指南”

5.9.1.1 Compiling MySQL for Debugging
5.9.1.2 Creating Trace Files
5.9.1.3 Using WER with PDB to create a Windows crashdump
5.9.1.4 Debugging mysqld under gdb
5.9.1.5 Using a Stack Trace
5.9.1.6 Using Server Logs to Find Causes of Errors in mysqld
5.9.1.7 Making a Test Case If You Experience Table Corruption